Skip to content

Latest commit

 

History

History
413 lines (258 loc) · 11.1 KB

ProductApi.md

File metadata and controls

413 lines (258 loc) · 11.1 KB

\ProductApi

All URIs are relative to https://navigator-api.tweakwise.com

Method HTTP request Description
ProductAddProduct Post /product Creates a new product.
ProductDeleteProduct Delete /product/{articleNumber} Deletes a single product based on the articlenumber.
ProductGetAllProducts Get /product Returns all products.
ProductGetProduct Get /product/{articleNumber} Returns a single product with the specified article number.
ProductPatchProduct Patch /product/{articleNumber} Patches a product with the specified change.
ProductUpdateProduct Put /product Updates a product with the specified data.

ProductAddProduct

ProductAddProduct(ctx).Product(product).Execute()

Creates a new product.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    product := *openapiclient.NewProductApiModel() // ProductApiModel | A product to add

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.ProductApi.ProductAddProduct(context.Background()).Product(product).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ProductApi.ProductAddProduct``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiProductAddProductRequest struct via the builder pattern

Name Type Description Notes
product ProductApiModel A product to add

Return type

(empty response body)

Authorization

apiKeyDefinition, instanceKeyDefinition

HTTP request headers

  • Content-Type: application/json, text/json
  • Accept: application/json, text/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ProductDeleteProduct

ProductDeleteProduct(ctx, articleNumber).Execute()

Deletes a single product based on the articlenumber.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    articleNumber := "articleNumber_example" // string | An article number to delete

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.ProductApi.ProductDeleteProduct(context.Background(), articleNumber).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ProductApi.ProductDeleteProduct``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
articleNumber string An article number to delete

Other Parameters

Other parameters are passed through a pointer to a apiProductDeleteProductRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

apiKeyDefinition, instanceKeyDefinition

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ProductGetAllProducts

[]ProductSummary ProductGetAllProducts(ctx).Execute()

Returns all products.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.ProductApi.ProductGetAllProducts(context.Background()).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ProductApi.ProductGetAllProducts``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ProductGetAllProducts`: []ProductSummary
    fmt.Fprintf(os.Stdout, "Response from `ProductApi.ProductGetAllProducts`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiProductGetAllProductsRequest struct via the builder pattern

Return type

[]ProductSummary

Authorization

apiKeyDefinition, instanceKeyDefinition

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ProductGetProduct

Product ProductGetProduct(ctx, articleNumber).Execute()

Returns a single product with the specified article number.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    articleNumber := "articleNumber_example" // string | An article number to get

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.ProductApi.ProductGetProduct(context.Background(), articleNumber).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ProductApi.ProductGetProduct``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ProductGetProduct`: Product
    fmt.Fprintf(os.Stdout, "Response from `ProductApi.ProductGetProduct`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
articleNumber string An article number to get

Other Parameters

Other parameters are passed through a pointer to a apiProductGetProductRequest struct via the builder pattern

Name Type Description Notes

Return type

Product

Authorization

apiKeyDefinition, instanceKeyDefinition

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ProductPatchProduct

map[string]interface{} ProductPatchProduct(ctx, articleNumber).Product(product).Execute()

Patches a product with the specified change.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    articleNumber := "articleNumber_example" // string | An articlenumber to patch
    product := *openapiclient.NewProductDeltaApiModel() // ProductDeltaApiModel | The product with values to patch

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.ProductApi.ProductPatchProduct(context.Background(), articleNumber).Product(product).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ProductApi.ProductPatchProduct``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ProductPatchProduct`: map[string]interface{}
    fmt.Fprintf(os.Stdout, "Response from `ProductApi.ProductPatchProduct`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
articleNumber string An articlenumber to patch

Other Parameters

Other parameters are passed through a pointer to a apiProductPatchProductRequest struct via the builder pattern

Name Type Description Notes

product | ProductDeltaApiModel | The product with values to patch |

Return type

map[string]interface{}

Authorization

apiKeyDefinition, instanceKeyDefinition

HTTP request headers

  • Content-Type: application/json, text/json
  • Accept: application/json, text/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ProductUpdateProduct

ProductUpdateProduct(ctx).Product(product).Execute()

Updates a product with the specified data.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    product := *openapiclient.NewProductApiModel() // ProductApiModel | A filled product to replace the existing product

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.ProductApi.ProductUpdateProduct(context.Background()).Product(product).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ProductApi.ProductUpdateProduct``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiProductUpdateProductRequest struct via the builder pattern

Name Type Description Notes
product ProductApiModel A filled product to replace the existing product

Return type

(empty response body)

Authorization

apiKeyDefinition, instanceKeyDefinition

HTTP request headers

  • Content-Type: application/json, text/json
  • Accept: application/json, text/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]