Skip to content

avis_client.ProductApi

All URIs are relative to http://localhost:8000

Method HTTP request Description
product_create POST /api/product/
product_destroy DELETE /api/product/{id}/
product_list GET /api/product/
product_partial_update PATCH /api/product/{id}/
product_retrieve GET /api/product/{id}/
product_update PUT /api/product/{id}/

product_create

Product product_create(product_request)

A base viewset that allows reading, creating and updating objects. The following functionalities are added by the mixins: * CreateModelMixin: allows creating objects * UpdateModelMixin: allows updating objects * DestroyModelMixin: allows deleting objects * OptimizedReadOnlyTracedViewSet: allows reading objects and adds tracing and optimized queryset fetching (with the use of the fields query parameter)

Example

  • Api Key Authentication (cookieAuth):
  • Api Key Authentication (ApiKeyAuth):
import time
import os
import avis_client
from avis_client.models.product import Product
from avis_client.models.product_request import ProductRequest
from avis_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost:8000
# See configuration.py for a list of all supported configuration parameters.
configuration = avis_client.Configuration(
    host = "http://localhost:8000"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: cookieAuth
configuration.api_key['cookieAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookieAuth'] = 'Bearer'

# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'

# Enter a context with an instance of the API client
with avis_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = avis_client.ProductApi(api_client)
    product_request = avis_client.ProductRequest() # ProductRequest | 

    try:
        api_response = api_instance.product_create(product_request)
        print("The response of ProductApi->product_create:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProductApi->product_create: %s\n" % e)

Parameters

Name Type Description Notes
product_request ProductRequest

Return type

Product

Authorization

cookieAuth, ApiKeyAuth

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded, multipart/form-data
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 -

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

product_destroy

product_destroy(id)

A base viewset that allows reading, creating and updating objects. The following functionalities are added by the mixins: * CreateModelMixin: allows creating objects * UpdateModelMixin: allows updating objects * DestroyModelMixin: allows deleting objects * OptimizedReadOnlyTracedViewSet: allows reading objects and adds tracing and optimized queryset fetching (with the use of the fields query parameter)

Example

  • Api Key Authentication (cookieAuth):
  • Api Key Authentication (ApiKeyAuth):
import time
import os
import avis_client
from avis_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost:8000
# See configuration.py for a list of all supported configuration parameters.
configuration = avis_client.Configuration(
    host = "http://localhost:8000"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: cookieAuth
configuration.api_key['cookieAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookieAuth'] = 'Bearer'

# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'

# Enter a context with an instance of the API client
with avis_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = avis_client.ProductApi(api_client)
    id = 56 # int | A unique integer value identifying this product.

    try:
        api_instance.product_destroy(id)
    except Exception as e:
        print("Exception when calling ProductApi->product_destroy: %s\n" % e)

Parameters

Name Type Description Notes
id int A unique integer value identifying this product.

Return type

void (empty response body)

Authorization

cookieAuth, ApiKeyAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 No response body -

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

product_list

PaginatedProductList product_list(category=category, fields=fields, id=id, identifier=identifier, ordering=ordering, page=page, page_size=page_size)

A base viewset that allows reading, creating and updating objects. The following functionalities are added by the mixins: * CreateModelMixin: allows creating objects * UpdateModelMixin: allows updating objects * DestroyModelMixin: allows deleting objects * OptimizedReadOnlyTracedViewSet: allows reading objects and adds tracing and optimized queryset fetching (with the use of the fields query parameter)

Example

  • Api Key Authentication (cookieAuth):
  • Api Key Authentication (ApiKeyAuth):
import time
import os
import avis_client
from avis_client.models.paginated_product_list import PaginatedProductList
from avis_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost:8000
# See configuration.py for a list of all supported configuration parameters.
configuration = avis_client.Configuration(
    host = "http://localhost:8000"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: cookieAuth
configuration.api_key['cookieAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookieAuth'] = 'Bearer'

# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'

# Enter a context with an instance of the API client
with avis_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = avis_client.ProductApi(api_client)
    category = [56] # List[int] | Multiple values may be separated by commas. (optional)
    fields = 'fields_example' # str |  (optional)
    id = [56] # List[int] | Multiple values may be separated by commas. (optional)
    identifier = ['identifier_example'] # List[str] | Multiple values may be separated by commas. (optional)
    ordering = 'ordering_example' # str | Which field to use when ordering the results. (optional)
    page = 56 # int | A page number within the paginated result set. (optional)
    page_size = 56 # int | Number of results to return per page. (optional)

    try:
        api_response = api_instance.product_list(category=category, fields=fields, id=id, identifier=identifier, ordering=ordering, page=page, page_size=page_size)
        print("The response of ProductApi->product_list:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProductApi->product_list: %s\n" % e)

Parameters

Name Type Description Notes
category List[int] Multiple values may be separated by commas. [optional]
fields str [optional]
id List[int] Multiple values may be separated by commas. [optional]
identifier List[str] Multiple values may be separated by commas. [optional]
ordering str Which field to use when ordering the results. [optional]
page int A page number within the paginated result set. [optional]
page_size int Number of results to return per page. [optional]

Return type

PaginatedProductList

Authorization

cookieAuth, ApiKeyAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 -

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

product_partial_update

Product product_partial_update(id, patched_product_request=patched_product_request)

A base viewset that allows reading, creating and updating objects. The following functionalities are added by the mixins: * CreateModelMixin: allows creating objects * UpdateModelMixin: allows updating objects * DestroyModelMixin: allows deleting objects * OptimizedReadOnlyTracedViewSet: allows reading objects and adds tracing and optimized queryset fetching (with the use of the fields query parameter)

Example

  • Api Key Authentication (cookieAuth):
  • Api Key Authentication (ApiKeyAuth):
import time
import os
import avis_client
from avis_client.models.patched_product_request import PatchedProductRequest
from avis_client.models.product import Product
from avis_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost:8000
# See configuration.py for a list of all supported configuration parameters.
configuration = avis_client.Configuration(
    host = "http://localhost:8000"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: cookieAuth
configuration.api_key['cookieAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookieAuth'] = 'Bearer'

# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'

# Enter a context with an instance of the API client
with avis_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = avis_client.ProductApi(api_client)
    id = 56 # int | A unique integer value identifying this product.
    patched_product_request = avis_client.PatchedProductRequest() # PatchedProductRequest |  (optional)

    try:
        api_response = api_instance.product_partial_update(id, patched_product_request=patched_product_request)
        print("The response of ProductApi->product_partial_update:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProductApi->product_partial_update: %s\n" % e)

Parameters

Name Type Description Notes
id int A unique integer value identifying this product.
patched_product_request PatchedProductRequest [optional]

Return type

Product

Authorization

cookieAuth, ApiKeyAuth

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded, multipart/form-data
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 -

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

product_retrieve

Product product_retrieve(id, fields=fields)

A base viewset that allows reading, creating and updating objects. The following functionalities are added by the mixins: * CreateModelMixin: allows creating objects * UpdateModelMixin: allows updating objects * DestroyModelMixin: allows deleting objects * OptimizedReadOnlyTracedViewSet: allows reading objects and adds tracing and optimized queryset fetching (with the use of the fields query parameter)

Example

  • Api Key Authentication (cookieAuth):
  • Api Key Authentication (ApiKeyAuth):
import time
import os
import avis_client
from avis_client.models.product import Product
from avis_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost:8000
# See configuration.py for a list of all supported configuration parameters.
configuration = avis_client.Configuration(
    host = "http://localhost:8000"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: cookieAuth
configuration.api_key['cookieAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookieAuth'] = 'Bearer'

# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'

# Enter a context with an instance of the API client
with avis_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = avis_client.ProductApi(api_client)
    id = 56 # int | A unique integer value identifying this product.
    fields = 'fields_example' # str |  (optional)

    try:
        api_response = api_instance.product_retrieve(id, fields=fields)
        print("The response of ProductApi->product_retrieve:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProductApi->product_retrieve: %s\n" % e)

Parameters

Name Type Description Notes
id int A unique integer value identifying this product.
fields str [optional]

Return type

Product

Authorization

cookieAuth, ApiKeyAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 -

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

product_update

Product product_update(id, product_request)

A base viewset that allows reading, creating and updating objects. The following functionalities are added by the mixins: * CreateModelMixin: allows creating objects * UpdateModelMixin: allows updating objects * DestroyModelMixin: allows deleting objects * OptimizedReadOnlyTracedViewSet: allows reading objects and adds tracing and optimized queryset fetching (with the use of the fields query parameter)

Example

  • Api Key Authentication (cookieAuth):
  • Api Key Authentication (ApiKeyAuth):
import time
import os
import avis_client
from avis_client.models.product import Product
from avis_client.models.product_request import ProductRequest
from avis_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost:8000
# See configuration.py for a list of all supported configuration parameters.
configuration = avis_client.Configuration(
    host = "http://localhost:8000"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: cookieAuth
configuration.api_key['cookieAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookieAuth'] = 'Bearer'

# Configure API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['ApiKeyAuth'] = 'Bearer'

# Enter a context with an instance of the API client
with avis_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = avis_client.ProductApi(api_client)
    id = 56 # int | A unique integer value identifying this product.
    product_request = avis_client.ProductRequest() # ProductRequest | 

    try:
        api_response = api_instance.product_update(id, product_request)
        print("The response of ProductApi->product_update:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling ProductApi->product_update: %s\n" % e)

Parameters

Name Type Description Notes
id int A unique integer value identifying this product.
product_request ProductRequest

Return type

Product

Authorization

cookieAuth, ApiKeyAuth

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded, multipart/form-data
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 -

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