All URIs are relative to http://example.com/rest/default
| Method | HTTP request | Description |
|---|---|---|
| DeleteV1SalesRulesRuleId | Delete /V1/salesRules/{ruleId} | salesRules/{ruleId} |
| GetV1SalesRulesRuleId | Get /V1/salesRules/{ruleId} | salesRules/{ruleId} |
| PutV1SalesRulesRuleId | Put /V1/salesRules/{ruleId} | salesRules/{ruleId} |
bool DeleteV1SalesRulesRuleId(ctx, ruleId).Execute()
salesRules/{ruleId}
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/Hevelop/go-client-magento"
)
func main() {
ruleId := int32(56) // int32 |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.SalesRulesRuleIdAPI.DeleteV1SalesRulesRuleId(context.Background(), ruleId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SalesRulesRuleIdAPI.DeleteV1SalesRulesRuleId``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DeleteV1SalesRulesRuleId`: bool
fmt.Fprintf(os.Stdout, "Response from `SalesRulesRuleIdAPI.DeleteV1SalesRulesRuleId`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| ruleId | int32 |
Other parameters are passed through a pointer to a apiDeleteV1SalesRulesRuleIdRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
bool
No authorization required
- Content-Type: Not defined
- Accept: application/json, application/xml
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SalesRuleDataRuleInterface GetV1SalesRulesRuleId(ctx, ruleId).Execute()
salesRules/{ruleId}
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/Hevelop/go-client-magento"
)
func main() {
ruleId := int32(56) // int32 |
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.SalesRulesRuleIdAPI.GetV1SalesRulesRuleId(context.Background(), ruleId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SalesRulesRuleIdAPI.GetV1SalesRulesRuleId``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `GetV1SalesRulesRuleId`: SalesRuleDataRuleInterface
fmt.Fprintf(os.Stdout, "Response from `SalesRulesRuleIdAPI.GetV1SalesRulesRuleId`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| ruleId | int32 |
Other parameters are passed through a pointer to a apiGetV1SalesRulesRuleIdRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
No authorization required
- Content-Type: Not defined
- Accept: application/json, application/xml
[Back to top] [Back to API list] [Back to Model list] [Back to README]
SalesRuleDataRuleInterface PutV1SalesRulesRuleId(ctx, ruleId).PostV1SalesRulesRequest(postV1SalesRulesRequest).Execute()
salesRules/{ruleId}
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/Hevelop/go-client-magento"
)
func main() {
ruleId := "ruleId_example" // string |
postV1SalesRulesRequest := *openapiclient.NewPostV1SalesRulesRequest(*openapiclient.NewSalesRuleDataRuleInterface([]int32{int32(123)}, []int32{int32(123)}, int32(123), false, false, false, int32(123), float32(123), int32(123), false, int32(123), false, "CouponType_example", false, int32(123))) // PostV1SalesRulesRequest | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.SalesRulesRuleIdAPI.PutV1SalesRulesRuleId(context.Background(), ruleId).PostV1SalesRulesRequest(postV1SalesRulesRequest).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SalesRulesRuleIdAPI.PutV1SalesRulesRuleId``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `PutV1SalesRulesRuleId`: SalesRuleDataRuleInterface
fmt.Fprintf(os.Stdout, "Response from `SalesRulesRuleIdAPI.PutV1SalesRulesRuleId`: %v\n", resp)
}| Name | Type | Description | Notes |
|---|---|---|---|
| ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
| ruleId | string |
Other parameters are passed through a pointer to a apiPutV1SalesRulesRuleIdRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|
postV1SalesRulesRequest | PostV1SalesRulesRequest | |
No authorization required
- Content-Type: application/json, application/xml
- Accept: application/json, application/xml
[Back to top] [Back to API list] [Back to Model list] [Back to README]