Skip to content

Latest commit

 

History

History
347 lines (225 loc) · 9.19 KB

File metadata and controls

347 lines (225 loc) · 9.19 KB

\ProductsAPI

All URIs are relative to https://connto.getopenpay.com

Method HTTP request Description
CreateProduct Post /products/ Create Product
DeleteProduct Delete /products/{product_id} Delete Product
GetProduct Get /products/{product_id} Get Product
ListProducts Post /products/list List Products
UpdateProduct Put /products/{product_id} Update Product

CreateProduct

ProductExternal CreateProduct(ctx).CreateProductRequest(createProductRequest).Execute()

Create Product

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/getopenpay/getopenpay-go"
)

func main() {
	createProductRequest := *openapiclient.NewCreateProductRequest("This is description for product1", "product1") // CreateProductRequest | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ProductsAPI.CreateProduct(context.Background()).CreateProductRequest(createProductRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ProductsAPI.CreateProduct``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `CreateProduct`: ProductExternal
	fmt.Fprintf(os.Stdout, "Response from `ProductsAPI.CreateProduct`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
createProductRequest CreateProductRequest

Return type

ProductExternal

Authorization

HTTPBearer

HTTP request headers

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

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

DeleteProduct

DeleteProductResponse DeleteProduct(ctx, productId).Execute()

Delete Product

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/getopenpay/getopenpay-go"
)

func main() {
	productId := "product_dev_abc123" // string | Unique identifier of the product.

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
productId string Unique identifier of the product.

Other Parameters

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

Name Type Description Notes

Return type

DeleteProductResponse

Authorization

HTTPBearer

HTTP request headers

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

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

GetProduct

ProductExternal GetProduct(ctx, productId).Execute()

Get Product

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/getopenpay/getopenpay-go"
)

func main() {
	productId := "product_dev_abc123" // string | Unique identifier of the product.

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

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
productId string Unique identifier of the product.

Other Parameters

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

Name Type Description Notes

Return type

ProductExternal

Authorization

HTTPBearer

HTTP request headers

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

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

ListProducts

ListResponseProductExternal ListProducts(ctx).ProductQueryParams(productQueryParams).Execute()

List Products

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/getopenpay/getopenpay-go"
)

func main() {
	productQueryParams := *openapiclient.NewProductQueryParams() // ProductQueryParams | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ProductsAPI.ListProducts(context.Background()).ProductQueryParams(productQueryParams).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ProductsAPI.ListProducts``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ListProducts`: ListResponseProductExternal
	fmt.Fprintf(os.Stdout, "Response from `ProductsAPI.ListProducts`: %v\n", resp)
}

Path Parameters

Other Parameters

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

Name Type Description Notes
productQueryParams ProductQueryParams

Return type

ListResponseProductExternal

Authorization

HTTPBearer

HTTP request headers

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

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

UpdateProduct

ProductExternal UpdateProduct(ctx, productId).UpdateProductRequest(updateProductRequest).Execute()

Update Product

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/getopenpay/getopenpay-go"
)

func main() {
	productId := "product_dev_abc123" // string | Unique identifier of the product.
	updateProductRequest := *openapiclient.NewUpdateProductRequest() // UpdateProductRequest | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.ProductsAPI.UpdateProduct(context.Background(), productId).UpdateProductRequest(updateProductRequest).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `ProductsAPI.UpdateProduct``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `UpdateProduct`: ProductExternal
	fmt.Fprintf(os.Stdout, "Response from `ProductsAPI.UpdateProduct`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
productId string Unique identifier of the product.

Other Parameters

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

Name Type Description Notes

updateProductRequest | UpdateProductRequest | |

Return type

ProductExternal

Authorization

HTTPBearer

HTTP request headers

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

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