# coding: utf-8

"""
    Zuora API Reference

    REST API reference for the Zuora Billing, Payments, and Central Platform! Check out the [REST API Overview](https://www.zuora.com/developer/api-references/api/overview/).

    The version of the OpenAPI document: 2024-05-20
    Contact: docs@zuora.com
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501

import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
from typing_extensions import Annotated

from pydantic import Field, StrictStr
from typing import Optional
from typing_extensions import Annotated
from zuora_sdk.models.attach_invoice_schedule_request import AttachInvoiceScheduleRequest
from zuora_sdk.models.bill_run_response import BillRunResponse
from zuora_sdk.models.common_response import CommonResponse
from zuora_sdk.models.create_invoice_schedule_request import CreateInvoiceScheduleRequest
from zuora_sdk.models.detach_invoice_schedule_request import DetachInvoiceScheduleRequest
from zuora_sdk.models.execute_invoice_schedule_request import ExecuteInvoiceScheduleRequest
from zuora_sdk.models.invoice_schedule_response import InvoiceScheduleResponse
from zuora_sdk.models.update_invoice_schedule_request import UpdateInvoiceScheduleRequest

from zuora_sdk.api_client import ApiClient, RequestSerialized
from zuora_sdk.api_response import ApiResponse
from zuora_sdk.rest import RESTResponseType


class InvoiceSchedulesApi:
    """NOTE: This class is auto generated by OpenAPI Generator
    Ref: https://openapi-generator.tech

    Do not edit the class manually.
    """

    def __init__(self, api_client=None) -> None:
        if api_client is None:
            api_client = ApiClient.get_default()
        self.api_client = api_client


    @validate_call
    def attach_invoice_schedule(
        self,
        schedule_key: Annotated[StrictStr, Field(description="The unique ID or number of the schedule to be paused. For example, 2c92c8955bd63cc1015bd7c151af02ab or IS-0000001. ")],
        attach_invoice_schedule_request: AttachInvoiceScheduleRequest,
        accept_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. ")] = None,
        content_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. ")] = None,
        authorization: Annotated[Optional[StrictStr], Field(description="The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). ")] = None,
        zuora_track_id: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). ")] = None,
        zuora_entity_ids: Annotated[Optional[StrictStr], Field(description="An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. ")] = None,
        zuora_version: Annotated[Optional[StrictStr], Field(description="The minor version of the Zuora REST API.  ")] = None,
        zuora_org_ids: Annotated[Optional[StrictStr], Field(description="Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. ")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CommonResponse:
        """Attach an invoice schedule

        Attach charges to an invoice schedule. You can attach charges to the invoice schedule if they were detached from the Invoice Schedule.  After the charges are attached to the invoice schedule, they can be automatically executed by Zuora Scheduler  or by the [Execute an invoice schedule](https://www.zuora.com/developer/api-references/api/operation/Post_ExecuteInvoiceSchedule/) API operation. 

        :param schedule_key: The unique ID or number of the schedule to be paused. For example, 2c92c8955bd63cc1015bd7c151af02ab or IS-0000001.  (required)
        :type schedule_key: str
        :param attach_invoice_schedule_request: (required)
        :type attach_invoice_schedule_request: AttachInvoiceScheduleRequest
        :param accept_encoding: Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. 
        :type accept_encoding: str
        :param content_encoding: Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. 
        :type content_encoding: str
        :param authorization: The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). 
        :type authorization: str
        :param zuora_track_id: A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). 
        :type zuora_track_id: str
        :param zuora_entity_ids: An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. 
        :type zuora_entity_ids: str
        :param zuora_version: The minor version of the Zuora REST API.  
        :type zuora_version: str
        :param zuora_org_ids: Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. 
        :type zuora_org_ids: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._attach_invoice_schedule_serialize(
            schedule_key=schedule_key,
            attach_invoice_schedule_request=attach_invoice_schedule_request,
            accept_encoding=accept_encoding,
            content_encoding=content_encoding,
            authorization=authorization,
            zuora_track_id=zuora_track_id,
            zuora_entity_ids=zuora_entity_ids,
            zuora_version=zuora_version,
            zuora_org_ids=zuora_org_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CommonResponse",
            '400': "CommonResponse",
            '401': "ProxyUnauthorizedResponse",
            '403': "CommonErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def attach_invoice_schedule_with_http_info(
        self,
        schedule_key: Annotated[StrictStr, Field(description="The unique ID or number of the schedule to be paused. For example, 2c92c8955bd63cc1015bd7c151af02ab or IS-0000001. ")],
        attach_invoice_schedule_request: AttachInvoiceScheduleRequest,
        accept_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. ")] = None,
        content_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. ")] = None,
        authorization: Annotated[Optional[StrictStr], Field(description="The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). ")] = None,
        zuora_track_id: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). ")] = None,
        zuora_entity_ids: Annotated[Optional[StrictStr], Field(description="An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. ")] = None,
        zuora_version: Annotated[Optional[StrictStr], Field(description="The minor version of the Zuora REST API.  ")] = None,
        zuora_org_ids: Annotated[Optional[StrictStr], Field(description="Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. ")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CommonResponse]:
        """Attach an invoice schedule

        Attach charges to an invoice schedule. You can attach charges to the invoice schedule if they were detached from the Invoice Schedule.  After the charges are attached to the invoice schedule, they can be automatically executed by Zuora Scheduler  or by the [Execute an invoice schedule](https://www.zuora.com/developer/api-references/api/operation/Post_ExecuteInvoiceSchedule/) API operation. 

        :param schedule_key: The unique ID or number of the schedule to be paused. For example, 2c92c8955bd63cc1015bd7c151af02ab or IS-0000001.  (required)
        :type schedule_key: str
        :param attach_invoice_schedule_request: (required)
        :type attach_invoice_schedule_request: AttachInvoiceScheduleRequest
        :param accept_encoding: Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. 
        :type accept_encoding: str
        :param content_encoding: Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. 
        :type content_encoding: str
        :param authorization: The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). 
        :type authorization: str
        :param zuora_track_id: A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). 
        :type zuora_track_id: str
        :param zuora_entity_ids: An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. 
        :type zuora_entity_ids: str
        :param zuora_version: The minor version of the Zuora REST API.  
        :type zuora_version: str
        :param zuora_org_ids: Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. 
        :type zuora_org_ids: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._attach_invoice_schedule_serialize(
            schedule_key=schedule_key,
            attach_invoice_schedule_request=attach_invoice_schedule_request,
            accept_encoding=accept_encoding,
            content_encoding=content_encoding,
            authorization=authorization,
            zuora_track_id=zuora_track_id,
            zuora_entity_ids=zuora_entity_ids,
            zuora_version=zuora_version,
            zuora_org_ids=zuora_org_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CommonResponse",
            '400': "CommonResponse",
            '401': "ProxyUnauthorizedResponse",
            '403': "CommonErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    def _attach_invoice_schedule_serialize(
        self,
        schedule_key,
        attach_invoice_schedule_request,
        accept_encoding,
        content_encoding,
        authorization,
        zuora_track_id,
        zuora_entity_ids,
        zuora_version,
        zuora_org_ids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if schedule_key is not None:
            _path_params['scheduleKey'] = schedule_key
        # process the query parameters
        # process the header parameters
        if accept_encoding is not None:
            _header_params['Accept-Encoding'] = accept_encoding
        if content_encoding is not None:
            _header_params['Content-Encoding'] = content_encoding
        if authorization is not None:
            _header_params['Authorization'] = authorization
        if zuora_track_id is not None:
            _header_params['Zuora-Track-Id'] = zuora_track_id
        if zuora_entity_ids is not None:
            _header_params['Zuora-Entity-Ids'] = zuora_entity_ids
        if zuora_version is not None:
            _header_params['Zuora-Version'] = zuora_version
        if zuora_org_ids is not None:
            _header_params['Zuora-Org-Ids'] = zuora_org_ids
        # process the form parameters
        # process the body parameter
        if attach_invoice_schedule_request is not None:
            _body_params = attach_invoice_schedule_request


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='PUT',
            resource_path='/v1/invoice-schedules/{scheduleKey}/attach',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def create_invoice_schedule(
        self,
        request: CreateInvoiceScheduleRequest,
        idempotency_key: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types.   With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident.  ")] = None,
        accept_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. ")] = None,
        content_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. ")] = None,
        authorization: Annotated[Optional[StrictStr], Field(description="The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). ")] = None,
        zuora_track_id: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). ")] = None,
        zuora_entity_ids: Annotated[Optional[StrictStr], Field(description="An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. ")] = None,
        zuora_version: Annotated[Optional[StrictStr], Field(description="The minor version of the Zuora REST API.  ")] = None,
        zuora_org_ids: Annotated[Optional[StrictStr], Field(description="Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. ")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> InvoiceScheduleResponse:
        """Create an invoice schedule

        Creates an invoice schedule.  ### Limitations  This API operation has the following limitations: * You can create at most 50 invoice schedule items in one request. * You can associate at most 10 orders with an invoice schedule in one request. * You can associate at most 300 subscriptions with an invoice schedule in one request, including those contained in orders and separate subscriptions. 

        :param request: (required)
        :type request: CreateInvoiceScheduleRequest
        :param idempotency_key: Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types.   With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident.  
        :type idempotency_key: str
        :param accept_encoding: Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. 
        :type accept_encoding: str
        :param content_encoding: Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. 
        :type content_encoding: str
        :param authorization: The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). 
        :type authorization: str
        :param zuora_track_id: A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). 
        :type zuora_track_id: str
        :param zuora_entity_ids: An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. 
        :type zuora_entity_ids: str
        :param zuora_version: The minor version of the Zuora REST API.  
        :type zuora_version: str
        :param zuora_org_ids: Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. 
        :type zuora_org_ids: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._create_invoice_schedule_serialize(
            request=request,
            idempotency_key=idempotency_key,
            accept_encoding=accept_encoding,
            content_encoding=content_encoding,
            authorization=authorization,
            zuora_track_id=zuora_track_id,
            zuora_entity_ids=zuora_entity_ids,
            zuora_version=zuora_version,
            zuora_org_ids=zuora_org_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "InvoiceScheduleResponse",
            '400': "CommonResponse",
            '401': "ProxyUnauthorizedResponse",
            '403': "CommonErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def create_invoice_schedule_with_http_info(
        self,
        request: CreateInvoiceScheduleRequest,
        idempotency_key: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types.   With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident.  ")] = None,
        accept_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. ")] = None,
        content_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. ")] = None,
        authorization: Annotated[Optional[StrictStr], Field(description="The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). ")] = None,
        zuora_track_id: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). ")] = None,
        zuora_entity_ids: Annotated[Optional[StrictStr], Field(description="An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. ")] = None,
        zuora_version: Annotated[Optional[StrictStr], Field(description="The minor version of the Zuora REST API.  ")] = None,
        zuora_org_ids: Annotated[Optional[StrictStr], Field(description="Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. ")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[InvoiceScheduleResponse]:
        """Create an invoice schedule

        Creates an invoice schedule.  ### Limitations  This API operation has the following limitations: * You can create at most 50 invoice schedule items in one request. * You can associate at most 10 orders with an invoice schedule in one request. * You can associate at most 300 subscriptions with an invoice schedule in one request, including those contained in orders and separate subscriptions. 

        :param request: (required)
        :type request: CreateInvoiceScheduleRequest
        :param idempotency_key: Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types.   With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident.  
        :type idempotency_key: str
        :param accept_encoding: Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. 
        :type accept_encoding: str
        :param content_encoding: Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. 
        :type content_encoding: str
        :param authorization: The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). 
        :type authorization: str
        :param zuora_track_id: A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). 
        :type zuora_track_id: str
        :param zuora_entity_ids: An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. 
        :type zuora_entity_ids: str
        :param zuora_version: The minor version of the Zuora REST API.  
        :type zuora_version: str
        :param zuora_org_ids: Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. 
        :type zuora_org_ids: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._create_invoice_schedule_serialize(
            request=request,
            idempotency_key=idempotency_key,
            accept_encoding=accept_encoding,
            content_encoding=content_encoding,
            authorization=authorization,
            zuora_track_id=zuora_track_id,
            zuora_entity_ids=zuora_entity_ids,
            zuora_version=zuora_version,
            zuora_org_ids=zuora_org_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "InvoiceScheduleResponse",
            '400': "CommonResponse",
            '401': "ProxyUnauthorizedResponse",
            '403': "CommonErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    def _create_invoice_schedule_serialize(
        self,
        request,
        idempotency_key,
        accept_encoding,
        content_encoding,
        authorization,
        zuora_track_id,
        zuora_entity_ids,
        zuora_version,
        zuora_org_ids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        # process the query parameters
        # process the header parameters
        if idempotency_key is not None:
            _header_params['Idempotency-Key'] = idempotency_key
        if accept_encoding is not None:
            _header_params['Accept-Encoding'] = accept_encoding
        if content_encoding is not None:
            _header_params['Content-Encoding'] = content_encoding
        if authorization is not None:
            _header_params['Authorization'] = authorization
        if zuora_track_id is not None:
            _header_params['Zuora-Track-Id'] = zuora_track_id
        if zuora_entity_ids is not None:
            _header_params['Zuora-Entity-Ids'] = zuora_entity_ids
        if zuora_version is not None:
            _header_params['Zuora-Version'] = zuora_version
        if zuora_org_ids is not None:
            _header_params['Zuora-Org-Ids'] = zuora_org_ids
        # process the form parameters
        # process the body parameter
        if request is not None:
            _body_params = request


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/v1/invoice-schedules',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def delete_invoice_schedule(
        self,
        schedule_key: Annotated[StrictStr, Field(description="The unique ID or number of the invoice schedule to be deleted. For example, 2c92c8955bd63cc1015bd7c151af02ab or IS-0000001. ")],
        accept_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. ")] = None,
        content_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. ")] = None,
        authorization: Annotated[Optional[StrictStr], Field(description="The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). ")] = None,
        zuora_track_id: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). ")] = None,
        zuora_entity_ids: Annotated[Optional[StrictStr], Field(description="An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. ")] = None,
        zuora_version: Annotated[Optional[StrictStr], Field(description="The minor version of the Zuora REST API.  ")] = None,
        zuora_org_ids: Annotated[Optional[StrictStr], Field(description="Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. ")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CommonResponse:
        """Delete an invoice schedule

        Deletes an invoice schedule in Pending status. The status of the invoice schedule to be deleted must be `Pending`. 

        :param schedule_key: The unique ID or number of the invoice schedule to be deleted. For example, 2c92c8955bd63cc1015bd7c151af02ab or IS-0000001.  (required)
        :type schedule_key: str
        :param accept_encoding: Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. 
        :type accept_encoding: str
        :param content_encoding: Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. 
        :type content_encoding: str
        :param authorization: The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). 
        :type authorization: str
        :param zuora_track_id: A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). 
        :type zuora_track_id: str
        :param zuora_entity_ids: An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. 
        :type zuora_entity_ids: str
        :param zuora_version: The minor version of the Zuora REST API.  
        :type zuora_version: str
        :param zuora_org_ids: Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. 
        :type zuora_org_ids: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._delete_invoice_schedule_serialize(
            schedule_key=schedule_key,
            accept_encoding=accept_encoding,
            content_encoding=content_encoding,
            authorization=authorization,
            zuora_track_id=zuora_track_id,
            zuora_entity_ids=zuora_entity_ids,
            zuora_version=zuora_version,
            zuora_org_ids=zuora_org_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CommonResponse",
            '400': "CommonResponse",
            '401': "ProxyUnauthorizedResponse",
            '403': "CommonErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def delete_invoice_schedule_with_http_info(
        self,
        schedule_key: Annotated[StrictStr, Field(description="The unique ID or number of the invoice schedule to be deleted. For example, 2c92c8955bd63cc1015bd7c151af02ab or IS-0000001. ")],
        accept_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. ")] = None,
        content_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. ")] = None,
        authorization: Annotated[Optional[StrictStr], Field(description="The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). ")] = None,
        zuora_track_id: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). ")] = None,
        zuora_entity_ids: Annotated[Optional[StrictStr], Field(description="An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. ")] = None,
        zuora_version: Annotated[Optional[StrictStr], Field(description="The minor version of the Zuora REST API.  ")] = None,
        zuora_org_ids: Annotated[Optional[StrictStr], Field(description="Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. ")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CommonResponse]:
        """Delete an invoice schedule

        Deletes an invoice schedule in Pending status. The status of the invoice schedule to be deleted must be `Pending`. 

        :param schedule_key: The unique ID or number of the invoice schedule to be deleted. For example, 2c92c8955bd63cc1015bd7c151af02ab or IS-0000001.  (required)
        :type schedule_key: str
        :param accept_encoding: Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. 
        :type accept_encoding: str
        :param content_encoding: Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. 
        :type content_encoding: str
        :param authorization: The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). 
        :type authorization: str
        :param zuora_track_id: A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). 
        :type zuora_track_id: str
        :param zuora_entity_ids: An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. 
        :type zuora_entity_ids: str
        :param zuora_version: The minor version of the Zuora REST API.  
        :type zuora_version: str
        :param zuora_org_ids: Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. 
        :type zuora_org_ids: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._delete_invoice_schedule_serialize(
            schedule_key=schedule_key,
            accept_encoding=accept_encoding,
            content_encoding=content_encoding,
            authorization=authorization,
            zuora_track_id=zuora_track_id,
            zuora_entity_ids=zuora_entity_ids,
            zuora_version=zuora_version,
            zuora_org_ids=zuora_org_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CommonResponse",
            '400': "CommonResponse",
            '401': "ProxyUnauthorizedResponse",
            '403': "CommonErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    def _delete_invoice_schedule_serialize(
        self,
        schedule_key,
        accept_encoding,
        content_encoding,
        authorization,
        zuora_track_id,
        zuora_entity_ids,
        zuora_version,
        zuora_org_ids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if schedule_key is not None:
            _path_params['scheduleKey'] = schedule_key
        # process the query parameters
        # process the header parameters
        if accept_encoding is not None:
            _header_params['Accept-Encoding'] = accept_encoding
        if content_encoding is not None:
            _header_params['Content-Encoding'] = content_encoding
        if authorization is not None:
            _header_params['Authorization'] = authorization
        if zuora_track_id is not None:
            _header_params['Zuora-Track-Id'] = zuora_track_id
        if zuora_entity_ids is not None:
            _header_params['Zuora-Entity-Ids'] = zuora_entity_ids
        if zuora_version is not None:
            _header_params['Zuora-Version'] = zuora_version
        if zuora_org_ids is not None:
            _header_params['Zuora-Org-Ids'] = zuora_org_ids
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='DELETE',
            resource_path='/v1/invoice-schedules/{scheduleKey}',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def detach_invoice_schedule(
        self,
        schedule_key: Annotated[StrictStr, Field(description="The unique ID or number of the schedule to be paused. For example, 2c92c8955bd63cc1015bd7c151af02ab or IS-0000001. ")],
        detach_invoice_schedule_request: DetachInvoiceScheduleRequest,
        accept_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. ")] = None,
        content_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. ")] = None,
        authorization: Annotated[Optional[StrictStr], Field(description="The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). ")] = None,
        zuora_track_id: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). ")] = None,
        zuora_entity_ids: Annotated[Optional[StrictStr], Field(description="An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. ")] = None,
        zuora_version: Annotated[Optional[StrictStr], Field(description="The minor version of the Zuora REST API.  ")] = None,
        zuora_org_ids: Annotated[Optional[StrictStr], Field(description="Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. ")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> CommonResponse:
        """Detach an invoice schedule

        Detach charges from an invoice schedule. After the charges detached from invoice schedule, they cannot be automatically executed by Zuora Scheduler or by the [Execute an invoice schedule](https://www.zuora.com/developer/api-references/api/operation/Post_ExecuteInvoiceSchedule/) API operation. 

        :param schedule_key: The unique ID or number of the schedule to be paused. For example, 2c92c8955bd63cc1015bd7c151af02ab or IS-0000001.  (required)
        :type schedule_key: str
        :param detach_invoice_schedule_request: (required)
        :type detach_invoice_schedule_request: DetachInvoiceScheduleRequest
        :param accept_encoding: Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. 
        :type accept_encoding: str
        :param content_encoding: Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. 
        :type content_encoding: str
        :param authorization: The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). 
        :type authorization: str
        :param zuora_track_id: A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). 
        :type zuora_track_id: str
        :param zuora_entity_ids: An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. 
        :type zuora_entity_ids: str
        :param zuora_version: The minor version of the Zuora REST API.  
        :type zuora_version: str
        :param zuora_org_ids: Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. 
        :type zuora_org_ids: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._detach_invoice_schedule_serialize(
            schedule_key=schedule_key,
            detach_invoice_schedule_request=detach_invoice_schedule_request,
            accept_encoding=accept_encoding,
            content_encoding=content_encoding,
            authorization=authorization,
            zuora_track_id=zuora_track_id,
            zuora_entity_ids=zuora_entity_ids,
            zuora_version=zuora_version,
            zuora_org_ids=zuora_org_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CommonResponse",
            '400': "CommonResponse",
            '401': "ProxyUnauthorizedResponse",
            '403': "CommonErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def detach_invoice_schedule_with_http_info(
        self,
        schedule_key: Annotated[StrictStr, Field(description="The unique ID or number of the schedule to be paused. For example, 2c92c8955bd63cc1015bd7c151af02ab or IS-0000001. ")],
        detach_invoice_schedule_request: DetachInvoiceScheduleRequest,
        accept_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. ")] = None,
        content_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. ")] = None,
        authorization: Annotated[Optional[StrictStr], Field(description="The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). ")] = None,
        zuora_track_id: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). ")] = None,
        zuora_entity_ids: Annotated[Optional[StrictStr], Field(description="An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. ")] = None,
        zuora_version: Annotated[Optional[StrictStr], Field(description="The minor version of the Zuora REST API.  ")] = None,
        zuora_org_ids: Annotated[Optional[StrictStr], Field(description="Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. ")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[CommonResponse]:
        """Detach an invoice schedule

        Detach charges from an invoice schedule. After the charges detached from invoice schedule, they cannot be automatically executed by Zuora Scheduler or by the [Execute an invoice schedule](https://www.zuora.com/developer/api-references/api/operation/Post_ExecuteInvoiceSchedule/) API operation. 

        :param schedule_key: The unique ID or number of the schedule to be paused. For example, 2c92c8955bd63cc1015bd7c151af02ab or IS-0000001.  (required)
        :type schedule_key: str
        :param detach_invoice_schedule_request: (required)
        :type detach_invoice_schedule_request: DetachInvoiceScheduleRequest
        :param accept_encoding: Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. 
        :type accept_encoding: str
        :param content_encoding: Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. 
        :type content_encoding: str
        :param authorization: The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). 
        :type authorization: str
        :param zuora_track_id: A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). 
        :type zuora_track_id: str
        :param zuora_entity_ids: An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. 
        :type zuora_entity_ids: str
        :param zuora_version: The minor version of the Zuora REST API.  
        :type zuora_version: str
        :param zuora_org_ids: Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. 
        :type zuora_org_ids: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._detach_invoice_schedule_serialize(
            schedule_key=schedule_key,
            detach_invoice_schedule_request=detach_invoice_schedule_request,
            accept_encoding=accept_encoding,
            content_encoding=content_encoding,
            authorization=authorization,
            zuora_track_id=zuora_track_id,
            zuora_entity_ids=zuora_entity_ids,
            zuora_version=zuora_version,
            zuora_org_ids=zuora_org_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "CommonResponse",
            '400': "CommonResponse",
            '401': "ProxyUnauthorizedResponse",
            '403': "CommonErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    def _detach_invoice_schedule_serialize(
        self,
        schedule_key,
        detach_invoice_schedule_request,
        accept_encoding,
        content_encoding,
        authorization,
        zuora_track_id,
        zuora_entity_ids,
        zuora_version,
        zuora_org_ids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if schedule_key is not None:
            _path_params['scheduleKey'] = schedule_key
        # process the query parameters
        # process the header parameters
        if accept_encoding is not None:
            _header_params['Accept-Encoding'] = accept_encoding
        if content_encoding is not None:
            _header_params['Content-Encoding'] = content_encoding
        if authorization is not None:
            _header_params['Authorization'] = authorization
        if zuora_track_id is not None:
            _header_params['Zuora-Track-Id'] = zuora_track_id
        if zuora_entity_ids is not None:
            _header_params['Zuora-Entity-Ids'] = zuora_entity_ids
        if zuora_version is not None:
            _header_params['Zuora-Version'] = zuora_version
        if zuora_org_ids is not None:
            _header_params['Zuora-Org-Ids'] = zuora_org_ids
        # process the form parameters
        # process the body parameter
        if detach_invoice_schedule_request is not None:
            _body_params = detach_invoice_schedule_request


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='PUT',
            resource_path='/v1/invoice-schedules/{scheduleKey}/detach',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def execute_invoice_schedule(
        self,
        schedule_key: Annotated[StrictStr, Field(description="The unique ID or number of the schedule to be executed. For example, 2c92c8955bd63cc1015bd7c151af02ab or IS-0000001. ")],
        request: ExecuteInvoiceScheduleRequest,
        idempotency_key: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types.   With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident.  ")] = None,
        accept_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. ")] = None,
        content_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. ")] = None,
        authorization: Annotated[Optional[StrictStr], Field(description="The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). ")] = None,
        zuora_track_id: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). ")] = None,
        zuora_entity_ids: Annotated[Optional[StrictStr], Field(description="An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. ")] = None,
        zuora_version: Annotated[Optional[StrictStr], Field(description="The minor version of the Zuora REST API.  ")] = None,
        zuora_org_ids: Annotated[Optional[StrictStr], Field(description="Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. ")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> BillRunResponse:
        """Execute an invoice schedule

        Executes an invoice schedule immediately.  During the execution, a bill run is created and generates an invoice or a credit memo asynchronously.  When you use this API operation to execute an invoice schedule item, you have the flexibility to decide whether to specify a specific item ID.  - If you specify the unique ID of an invoice schedule item to be executed in the request, the corresponding invoice schedule item is executed. - If you do not specify the ID of any invoice schedule item in the request, the subscription end date is used as the target date to determine the next pending schedule item to be executed.   For more samples, see [Execute invoice schedules](https://knowledgecenter.zuora.com/Billing/Billing_and_Payments/Billing_Schedule/Billing_Schedule_tutorials/Execute_invoice_schedules). 

        :param schedule_key: The unique ID or number of the schedule to be executed. For example, 2c92c8955bd63cc1015bd7c151af02ab or IS-0000001.  (required)
        :type schedule_key: str
        :param request: (required)
        :type request: ExecuteInvoiceScheduleRequest
        :param idempotency_key: Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types.   With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident.  
        :type idempotency_key: str
        :param accept_encoding: Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. 
        :type accept_encoding: str
        :param content_encoding: Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. 
        :type content_encoding: str
        :param authorization: The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). 
        :type authorization: str
        :param zuora_track_id: A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). 
        :type zuora_track_id: str
        :param zuora_entity_ids: An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. 
        :type zuora_entity_ids: str
        :param zuora_version: The minor version of the Zuora REST API.  
        :type zuora_version: str
        :param zuora_org_ids: Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. 
        :type zuora_org_ids: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._execute_invoice_schedule_serialize(
            schedule_key=schedule_key,
            request=request,
            idempotency_key=idempotency_key,
            accept_encoding=accept_encoding,
            content_encoding=content_encoding,
            authorization=authorization,
            zuora_track_id=zuora_track_id,
            zuora_entity_ids=zuora_entity_ids,
            zuora_version=zuora_version,
            zuora_org_ids=zuora_org_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "BillRunResponse",
            '400': "CommonResponse",
            '401': "ProxyUnauthorizedResponse",
            '403': "CommonErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def execute_invoice_schedule_with_http_info(
        self,
        schedule_key: Annotated[StrictStr, Field(description="The unique ID or number of the schedule to be executed. For example, 2c92c8955bd63cc1015bd7c151af02ab or IS-0000001. ")],
        request: ExecuteInvoiceScheduleRequest,
        idempotency_key: Annotated[Optional[Annotated[str, Field(strict=True, max_length=255)]], Field(description="Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types.   With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident.  ")] = None,
        accept_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. ")] = None,
        content_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. ")] = None,
        authorization: Annotated[Optional[StrictStr], Field(description="The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). ")] = None,
        zuora_track_id: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). ")] = None,
        zuora_entity_ids: Annotated[Optional[StrictStr], Field(description="An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. ")] = None,
        zuora_version: Annotated[Optional[StrictStr], Field(description="The minor version of the Zuora REST API.  ")] = None,
        zuora_org_ids: Annotated[Optional[StrictStr], Field(description="Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. ")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[BillRunResponse]:
        """Execute an invoice schedule

        Executes an invoice schedule immediately.  During the execution, a bill run is created and generates an invoice or a credit memo asynchronously.  When you use this API operation to execute an invoice schedule item, you have the flexibility to decide whether to specify a specific item ID.  - If you specify the unique ID of an invoice schedule item to be executed in the request, the corresponding invoice schedule item is executed. - If you do not specify the ID of any invoice schedule item in the request, the subscription end date is used as the target date to determine the next pending schedule item to be executed.   For more samples, see [Execute invoice schedules](https://knowledgecenter.zuora.com/Billing/Billing_and_Payments/Billing_Schedule/Billing_Schedule_tutorials/Execute_invoice_schedules). 

        :param schedule_key: The unique ID or number of the schedule to be executed. For example, 2c92c8955bd63cc1015bd7c151af02ab or IS-0000001.  (required)
        :type schedule_key: str
        :param request: (required)
        :type request: ExecuteInvoiceScheduleRequest
        :param idempotency_key: Specify a unique idempotency key if you want to perform an idempotent POST or PATCH request. Do not use this header in other request types.   With this header specified, the Zuora server can identify subsequent retries of the same request using this value, which prevents the same operation from being performed multiple times by accident.  
        :type idempotency_key: str
        :param accept_encoding: Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. 
        :type accept_encoding: str
        :param content_encoding: Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. 
        :type content_encoding: str
        :param authorization: The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). 
        :type authorization: str
        :param zuora_track_id: A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). 
        :type zuora_track_id: str
        :param zuora_entity_ids: An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. 
        :type zuora_entity_ids: str
        :param zuora_version: The minor version of the Zuora REST API.  
        :type zuora_version: str
        :param zuora_org_ids: Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. 
        :type zuora_org_ids: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._execute_invoice_schedule_serialize(
            schedule_key=schedule_key,
            request=request,
            idempotency_key=idempotency_key,
            accept_encoding=accept_encoding,
            content_encoding=content_encoding,
            authorization=authorization,
            zuora_track_id=zuora_track_id,
            zuora_entity_ids=zuora_entity_ids,
            zuora_version=zuora_version,
            zuora_org_ids=zuora_org_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "BillRunResponse",
            '400': "CommonResponse",
            '401': "ProxyUnauthorizedResponse",
            '403': "CommonErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    def _execute_invoice_schedule_serialize(
        self,
        schedule_key,
        request,
        idempotency_key,
        accept_encoding,
        content_encoding,
        authorization,
        zuora_track_id,
        zuora_entity_ids,
        zuora_version,
        zuora_org_ids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if schedule_key is not None:
            _path_params['scheduleKey'] = schedule_key
        # process the query parameters
        # process the header parameters
        if idempotency_key is not None:
            _header_params['Idempotency-Key'] = idempotency_key
        if accept_encoding is not None:
            _header_params['Accept-Encoding'] = accept_encoding
        if content_encoding is not None:
            _header_params['Content-Encoding'] = content_encoding
        if authorization is not None:
            _header_params['Authorization'] = authorization
        if zuora_track_id is not None:
            _header_params['Zuora-Track-Id'] = zuora_track_id
        if zuora_entity_ids is not None:
            _header_params['Zuora-Entity-Ids'] = zuora_entity_ids
        if zuora_version is not None:
            _header_params['Zuora-Version'] = zuora_version
        if zuora_org_ids is not None:
            _header_params['Zuora-Org-Ids'] = zuora_org_ids
        # process the form parameters
        # process the body parameter
        if request is not None:
            _body_params = request


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json', 
                    'autoEmail', 
                    'autoPost', 
                    'autoRenewal', 
                    'billRunFilters', 
                    'billRunNumber', 
                    'createdById', 
                    'createdDate', 
                    'id', 
                    'invoiceDate', 
                    'noEmailForZeroAmountInvoice', 
                    'status', 
                    'success', 
                    'targetDate', 
                    'updatedById', 
                    'updatedDate'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='POST',
            resource_path='/v1/invoice-schedules/{scheduleKey}/execute',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def get_invoice_schedule(
        self,
        schedule_key: Annotated[StrictStr, Field(description="The unique ID or number of the invoice schedule to be retrieved. For example, 2c92c8955bd63cc1015bd7c151af02ab or IS-0000001. ")],
        accept_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. ")] = None,
        content_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. ")] = None,
        authorization: Annotated[Optional[StrictStr], Field(description="The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). ")] = None,
        zuora_track_id: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). ")] = None,
        zuora_entity_ids: Annotated[Optional[StrictStr], Field(description="An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. ")] = None,
        zuora_version: Annotated[Optional[StrictStr], Field(description="The minor version of the Zuora REST API.  ")] = None,
        zuora_org_ids: Annotated[Optional[StrictStr], Field(description="Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. ")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> InvoiceScheduleResponse:
        """Retrieve an invoice schedule

        Retrieves detailed information about an invoice schedule. 

        :param schedule_key: The unique ID or number of the invoice schedule to be retrieved. For example, 2c92c8955bd63cc1015bd7c151af02ab or IS-0000001.  (required)
        :type schedule_key: str
        :param accept_encoding: Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. 
        :type accept_encoding: str
        :param content_encoding: Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. 
        :type content_encoding: str
        :param authorization: The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). 
        :type authorization: str
        :param zuora_track_id: A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). 
        :type zuora_track_id: str
        :param zuora_entity_ids: An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. 
        :type zuora_entity_ids: str
        :param zuora_version: The minor version of the Zuora REST API.  
        :type zuora_version: str
        :param zuora_org_ids: Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. 
        :type zuora_org_ids: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_invoice_schedule_serialize(
            schedule_key=schedule_key,
            accept_encoding=accept_encoding,
            content_encoding=content_encoding,
            authorization=authorization,
            zuora_track_id=zuora_track_id,
            zuora_entity_ids=zuora_entity_ids,
            zuora_version=zuora_version,
            zuora_org_ids=zuora_org_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "InvoiceScheduleResponse",
            '400': "CommonResponse",
            '401': "ProxyUnauthorizedResponse",
            '403': "CommonErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def get_invoice_schedule_with_http_info(
        self,
        schedule_key: Annotated[StrictStr, Field(description="The unique ID or number of the invoice schedule to be retrieved. For example, 2c92c8955bd63cc1015bd7c151af02ab or IS-0000001. ")],
        accept_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. ")] = None,
        content_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. ")] = None,
        authorization: Annotated[Optional[StrictStr], Field(description="The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). ")] = None,
        zuora_track_id: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). ")] = None,
        zuora_entity_ids: Annotated[Optional[StrictStr], Field(description="An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. ")] = None,
        zuora_version: Annotated[Optional[StrictStr], Field(description="The minor version of the Zuora REST API.  ")] = None,
        zuora_org_ids: Annotated[Optional[StrictStr], Field(description="Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. ")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[InvoiceScheduleResponse]:
        """Retrieve an invoice schedule

        Retrieves detailed information about an invoice schedule. 

        :param schedule_key: The unique ID or number of the invoice schedule to be retrieved. For example, 2c92c8955bd63cc1015bd7c151af02ab or IS-0000001.  (required)
        :type schedule_key: str
        :param accept_encoding: Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. 
        :type accept_encoding: str
        :param content_encoding: Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. 
        :type content_encoding: str
        :param authorization: The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). 
        :type authorization: str
        :param zuora_track_id: A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). 
        :type zuora_track_id: str
        :param zuora_entity_ids: An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. 
        :type zuora_entity_ids: str
        :param zuora_version: The minor version of the Zuora REST API.  
        :type zuora_version: str
        :param zuora_org_ids: Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. 
        :type zuora_org_ids: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._get_invoice_schedule_serialize(
            schedule_key=schedule_key,
            accept_encoding=accept_encoding,
            content_encoding=content_encoding,
            authorization=authorization,
            zuora_track_id=zuora_track_id,
            zuora_entity_ids=zuora_entity_ids,
            zuora_version=zuora_version,
            zuora_org_ids=zuora_org_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "InvoiceScheduleResponse",
            '400': "CommonResponse",
            '401': "ProxyUnauthorizedResponse",
            '403': "CommonErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    def _get_invoice_schedule_serialize(
        self,
        schedule_key,
        accept_encoding,
        content_encoding,
        authorization,
        zuora_track_id,
        zuora_entity_ids,
        zuora_version,
        zuora_org_ids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if schedule_key is not None:
            _path_params['scheduleKey'] = schedule_key
        # process the query parameters
        # process the header parameters
        if accept_encoding is not None:
            _header_params['Accept-Encoding'] = accept_encoding
        if content_encoding is not None:
            _header_params['Content-Encoding'] = content_encoding
        if authorization is not None:
            _header_params['Authorization'] = authorization
        if zuora_track_id is not None:
            _header_params['Zuora-Track-Id'] = zuora_track_id
        if zuora_entity_ids is not None:
            _header_params['Zuora-Entity-Ids'] = zuora_entity_ids
        if zuora_version is not None:
            _header_params['Zuora-Version'] = zuora_version
        if zuora_org_ids is not None:
            _header_params['Zuora-Org-Ids'] = zuora_org_ids
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/v1/invoice-schedules/{scheduleKey}',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def pause_invoice_schedule(
        self,
        schedule_key: Annotated[StrictStr, Field(description="The unique ID or number of the schedule to be paused. For example, 2c92c8955bd63cc1015bd7c151af02ab or IS-0000001. ")],
        accept_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. ")] = None,
        content_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. ")] = None,
        authorization: Annotated[Optional[StrictStr], Field(description="The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). ")] = None,
        zuora_track_id: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). ")] = None,
        zuora_entity_ids: Annotated[Optional[StrictStr], Field(description="An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. ")] = None,
        zuora_version: Annotated[Optional[StrictStr], Field(description="The minor version of the Zuora REST API.  ")] = None,
        zuora_org_ids: Annotated[Optional[StrictStr], Field(description="Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. ")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> InvoiceScheduleResponse:
        """Pause an invoice schedule

        Pauses an invoice schedule immediately.  After one invoice schedule is paused, it cannot be automatically executed by Zuora Scheduler or by the [Execute an invoice schedule](https://www.zuora.com/developer/api-references/api/operation/Post_ExecuteInvoiceSchedule/) API operation.  If you want to run a paused invoice schedule, you can create a bill run with the target date greater than the next run date of the invoice schedule. 

        :param schedule_key: The unique ID or number of the schedule to be paused. For example, 2c92c8955bd63cc1015bd7c151af02ab or IS-0000001.  (required)
        :type schedule_key: str
        :param accept_encoding: Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. 
        :type accept_encoding: str
        :param content_encoding: Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. 
        :type content_encoding: str
        :param authorization: The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). 
        :type authorization: str
        :param zuora_track_id: A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). 
        :type zuora_track_id: str
        :param zuora_entity_ids: An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. 
        :type zuora_entity_ids: str
        :param zuora_version: The minor version of the Zuora REST API.  
        :type zuora_version: str
        :param zuora_org_ids: Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. 
        :type zuora_org_ids: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._pause_invoice_schedule_serialize(
            schedule_key=schedule_key,
            accept_encoding=accept_encoding,
            content_encoding=content_encoding,
            authorization=authorization,
            zuora_track_id=zuora_track_id,
            zuora_entity_ids=zuora_entity_ids,
            zuora_version=zuora_version,
            zuora_org_ids=zuora_org_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "InvoiceScheduleResponse",
            '400': "CommonResponse",
            '401': "ProxyUnauthorizedResponse",
            '403': "CommonErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def pause_invoice_schedule_with_http_info(
        self,
        schedule_key: Annotated[StrictStr, Field(description="The unique ID or number of the schedule to be paused. For example, 2c92c8955bd63cc1015bd7c151af02ab or IS-0000001. ")],
        accept_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. ")] = None,
        content_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. ")] = None,
        authorization: Annotated[Optional[StrictStr], Field(description="The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). ")] = None,
        zuora_track_id: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). ")] = None,
        zuora_entity_ids: Annotated[Optional[StrictStr], Field(description="An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. ")] = None,
        zuora_version: Annotated[Optional[StrictStr], Field(description="The minor version of the Zuora REST API.  ")] = None,
        zuora_org_ids: Annotated[Optional[StrictStr], Field(description="Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. ")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[InvoiceScheduleResponse]:
        """Pause an invoice schedule

        Pauses an invoice schedule immediately.  After one invoice schedule is paused, it cannot be automatically executed by Zuora Scheduler or by the [Execute an invoice schedule](https://www.zuora.com/developer/api-references/api/operation/Post_ExecuteInvoiceSchedule/) API operation.  If you want to run a paused invoice schedule, you can create a bill run with the target date greater than the next run date of the invoice schedule. 

        :param schedule_key: The unique ID or number of the schedule to be paused. For example, 2c92c8955bd63cc1015bd7c151af02ab or IS-0000001.  (required)
        :type schedule_key: str
        :param accept_encoding: Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. 
        :type accept_encoding: str
        :param content_encoding: Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. 
        :type content_encoding: str
        :param authorization: The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). 
        :type authorization: str
        :param zuora_track_id: A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). 
        :type zuora_track_id: str
        :param zuora_entity_ids: An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. 
        :type zuora_entity_ids: str
        :param zuora_version: The minor version of the Zuora REST API.  
        :type zuora_version: str
        :param zuora_org_ids: Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. 
        :type zuora_org_ids: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._pause_invoice_schedule_serialize(
            schedule_key=schedule_key,
            accept_encoding=accept_encoding,
            content_encoding=content_encoding,
            authorization=authorization,
            zuora_track_id=zuora_track_id,
            zuora_entity_ids=zuora_entity_ids,
            zuora_version=zuora_version,
            zuora_org_ids=zuora_org_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "InvoiceScheduleResponse",
            '400': "CommonResponse",
            '401': "ProxyUnauthorizedResponse",
            '403': "CommonErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    def _pause_invoice_schedule_serialize(
        self,
        schedule_key,
        accept_encoding,
        content_encoding,
        authorization,
        zuora_track_id,
        zuora_entity_ids,
        zuora_version,
        zuora_org_ids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if schedule_key is not None:
            _path_params['scheduleKey'] = schedule_key
        # process the query parameters
        # process the header parameters
        if accept_encoding is not None:
            _header_params['Accept-Encoding'] = accept_encoding
        if content_encoding is not None:
            _header_params['Content-Encoding'] = content_encoding
        if authorization is not None:
            _header_params['Authorization'] = authorization
        if zuora_track_id is not None:
            _header_params['Zuora-Track-Id'] = zuora_track_id
        if zuora_entity_ids is not None:
            _header_params['Zuora-Entity-Ids'] = zuora_entity_ids
        if zuora_version is not None:
            _header_params['Zuora-Version'] = zuora_version
        if zuora_org_ids is not None:
            _header_params['Zuora-Org-Ids'] = zuora_org_ids
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='PUT',
            resource_path='/v1/invoice-schedules/{scheduleKey}/pause',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def resume_invoice_schedule(
        self,
        schedule_key: Annotated[StrictStr, Field(description="The unique ID or number of the schedule to be resumed. For example, 2c92c8955bd63cc1015bd7c151af02ab or IS-0000001. ")],
        accept_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. ")] = None,
        content_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. ")] = None,
        authorization: Annotated[Optional[StrictStr], Field(description="The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). ")] = None,
        zuora_track_id: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). ")] = None,
        zuora_entity_ids: Annotated[Optional[StrictStr], Field(description="An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. ")] = None,
        zuora_version: Annotated[Optional[StrictStr], Field(description="The minor version of the Zuora REST API.  ")] = None,
        zuora_org_ids: Annotated[Optional[StrictStr], Field(description="Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. ")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> InvoiceScheduleResponse:
        """Resume an invoice schedule

        Resumes an invoice schedule in Paused status immediately.  After an invoice schedule is resumed, it can continue to be automatically executed by Zuora Scheduler or by the [Execute an invoice schedule](https://www.zuora.com/developer/api-references/api/operation/Post_ExecuteInvoiceSchedule/) API operation. 

        :param schedule_key: The unique ID or number of the schedule to be resumed. For example, 2c92c8955bd63cc1015bd7c151af02ab or IS-0000001.  (required)
        :type schedule_key: str
        :param accept_encoding: Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. 
        :type accept_encoding: str
        :param content_encoding: Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. 
        :type content_encoding: str
        :param authorization: The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). 
        :type authorization: str
        :param zuora_track_id: A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). 
        :type zuora_track_id: str
        :param zuora_entity_ids: An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. 
        :type zuora_entity_ids: str
        :param zuora_version: The minor version of the Zuora REST API.  
        :type zuora_version: str
        :param zuora_org_ids: Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. 
        :type zuora_org_ids: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._resume_invoice_schedule_serialize(
            schedule_key=schedule_key,
            accept_encoding=accept_encoding,
            content_encoding=content_encoding,
            authorization=authorization,
            zuora_track_id=zuora_track_id,
            zuora_entity_ids=zuora_entity_ids,
            zuora_version=zuora_version,
            zuora_org_ids=zuora_org_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "InvoiceScheduleResponse",
            '400': "CommonResponse",
            '401': "ProxyUnauthorizedResponse",
            '403': "CommonErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def resume_invoice_schedule_with_http_info(
        self,
        schedule_key: Annotated[StrictStr, Field(description="The unique ID or number of the schedule to be resumed. For example, 2c92c8955bd63cc1015bd7c151af02ab or IS-0000001. ")],
        accept_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. ")] = None,
        content_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. ")] = None,
        authorization: Annotated[Optional[StrictStr], Field(description="The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). ")] = None,
        zuora_track_id: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). ")] = None,
        zuora_entity_ids: Annotated[Optional[StrictStr], Field(description="An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. ")] = None,
        zuora_version: Annotated[Optional[StrictStr], Field(description="The minor version of the Zuora REST API.  ")] = None,
        zuora_org_ids: Annotated[Optional[StrictStr], Field(description="Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. ")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[InvoiceScheduleResponse]:
        """Resume an invoice schedule

        Resumes an invoice schedule in Paused status immediately.  After an invoice schedule is resumed, it can continue to be automatically executed by Zuora Scheduler or by the [Execute an invoice schedule](https://www.zuora.com/developer/api-references/api/operation/Post_ExecuteInvoiceSchedule/) API operation. 

        :param schedule_key: The unique ID or number of the schedule to be resumed. For example, 2c92c8955bd63cc1015bd7c151af02ab or IS-0000001.  (required)
        :type schedule_key: str
        :param accept_encoding: Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. 
        :type accept_encoding: str
        :param content_encoding: Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. 
        :type content_encoding: str
        :param authorization: The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). 
        :type authorization: str
        :param zuora_track_id: A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). 
        :type zuora_track_id: str
        :param zuora_entity_ids: An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. 
        :type zuora_entity_ids: str
        :param zuora_version: The minor version of the Zuora REST API.  
        :type zuora_version: str
        :param zuora_org_ids: Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. 
        :type zuora_org_ids: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._resume_invoice_schedule_serialize(
            schedule_key=schedule_key,
            accept_encoding=accept_encoding,
            content_encoding=content_encoding,
            authorization=authorization,
            zuora_track_id=zuora_track_id,
            zuora_entity_ids=zuora_entity_ids,
            zuora_version=zuora_version,
            zuora_org_ids=zuora_org_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "InvoiceScheduleResponse",
            '400': "CommonResponse",
            '401': "ProxyUnauthorizedResponse",
            '403': "CommonErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    def _resume_invoice_schedule_serialize(
        self,
        schedule_key,
        accept_encoding,
        content_encoding,
        authorization,
        zuora_track_id,
        zuora_entity_ids,
        zuora_version,
        zuora_org_ids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if schedule_key is not None:
            _path_params['scheduleKey'] = schedule_key
        # process the query parameters
        # process the header parameters
        if accept_encoding is not None:
            _header_params['Accept-Encoding'] = accept_encoding
        if content_encoding is not None:
            _header_params['Content-Encoding'] = content_encoding
        if authorization is not None:
            _header_params['Authorization'] = authorization
        if zuora_track_id is not None:
            _header_params['Zuora-Track-Id'] = zuora_track_id
        if zuora_entity_ids is not None:
            _header_params['Zuora-Entity-Ids'] = zuora_entity_ids
        if zuora_version is not None:
            _header_params['Zuora-Version'] = zuora_version
        if zuora_org_ids is not None:
            _header_params['Zuora-Org-Ids'] = zuora_org_ids
        # process the form parameters
        # process the body parameter


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )


        # authentication setting
        _auth_settings: List[str] = [
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='PUT',
            resource_path='/v1/invoice-schedules/{scheduleKey}/resume',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )




    @validate_call
    def update_invoice_schedule(
        self,
        schedule_key: Annotated[StrictStr, Field(description="The unique ID or number of the invoice schedule to be updated. For example, 2c92c8955bd63cc1015bd7c151af02ab or IS-0000001. ")],
        request: UpdateInvoiceScheduleRequest,
        accept_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. ")] = None,
        content_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. ")] = None,
        authorization: Annotated[Optional[StrictStr], Field(description="The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). ")] = None,
        zuora_track_id: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). ")] = None,
        zuora_entity_ids: Annotated[Optional[StrictStr], Field(description="An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. ")] = None,
        zuora_version: Annotated[Optional[StrictStr], Field(description="The minor version of the Zuora REST API.  ")] = None,
        zuora_org_ids: Annotated[Optional[StrictStr], Field(description="Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. ")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> InvoiceScheduleResponse:
        """Update an invoice schedule

        Updates a pending invoice schedule.  You can use this API operation to update invoice schedules in the following aspects: - Update notes and pending invoice schedule items - Update orders associated with invoice schedules - Remove or add invoice schedule items  For more samples, see [Edit invoice schedules](https://knowledgecenter.zuora.com/Billing/Billing_and_Payments/Billing_Schedule/Billing_Schedule_tutorials/Edit_invoice_schedules).  ### Restrictions and limitations   When updating invoice schedules through the REST API, keep the following restrictions and limitations in mind: - You can only update invoice schedule items in Pending status. - You can only add orders or specific subscriptions to pending invoice schedules, and remove orders or specific subscriptions from pending invoice schedules. - For the invoice schedule items that you want to update, you must include the new values for these items in the request. - For the invoice schedule items that you want to keep unchanged, you must include all the existing information about these items in the request. Otherwise, the existing invoice schedule items that you do not mention in the request are deleted. - For the orders that you want to keep unchanged for an invoice schedule, you must include all the existing order numbers associated with the invoice schedule in the request. Otherwise, the existing orders that you do not mention in the request are removed. 

        :param schedule_key: The unique ID or number of the invoice schedule to be updated. For example, 2c92c8955bd63cc1015bd7c151af02ab or IS-0000001.  (required)
        :type schedule_key: str
        :param request: (required)
        :type request: UpdateInvoiceScheduleRequest
        :param accept_encoding: Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. 
        :type accept_encoding: str
        :param content_encoding: Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. 
        :type content_encoding: str
        :param authorization: The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). 
        :type authorization: str
        :param zuora_track_id: A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). 
        :type zuora_track_id: str
        :param zuora_entity_ids: An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. 
        :type zuora_entity_ids: str
        :param zuora_version: The minor version of the Zuora REST API.  
        :type zuora_version: str
        :param zuora_org_ids: Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. 
        :type zuora_org_ids: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._update_invoice_schedule_serialize(
            schedule_key=schedule_key,
            request=request,
            accept_encoding=accept_encoding,
            content_encoding=content_encoding,
            authorization=authorization,
            zuora_track_id=zuora_track_id,
            zuora_entity_ids=zuora_entity_ids,
            zuora_version=zuora_version,
            zuora_org_ids=zuora_org_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "InvoiceScheduleResponse",
            '400': "CommonResponse",
            '401': "ProxyUnauthorizedResponse",
            '403': "CommonErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        ).data


    @validate_call
    def update_invoice_schedule_with_http_info(
        self,
        schedule_key: Annotated[StrictStr, Field(description="The unique ID or number of the invoice schedule to be updated. For example, 2c92c8955bd63cc1015bd7c151af02ab or IS-0000001. ")],
        request: UpdateInvoiceScheduleRequest,
        accept_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. ")] = None,
        content_encoding: Annotated[Optional[StrictStr], Field(description="Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. ")] = None,
        authorization: Annotated[Optional[StrictStr], Field(description="The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). ")] = None,
        zuora_track_id: Annotated[Optional[Annotated[str, Field(strict=True, max_length=64)]], Field(description="A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). ")] = None,
        zuora_entity_ids: Annotated[Optional[StrictStr], Field(description="An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. ")] = None,
        zuora_version: Annotated[Optional[StrictStr], Field(description="The minor version of the Zuora REST API.  ")] = None,
        zuora_org_ids: Annotated[Optional[StrictStr], Field(description="Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. ")] = None,
        _request_timeout: Union[
            None,
            Annotated[StrictFloat, Field(gt=0)],
            Tuple[
                Annotated[StrictFloat, Field(gt=0)],
                Annotated[StrictFloat, Field(gt=0)]
            ]
        ] = None,
        _request_auth: Optional[Dict[StrictStr, Any]] = None,
        _content_type: Optional[StrictStr] = None,
        _headers: Optional[Dict[StrictStr, Any]] = None,
        _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
    ) -> ApiResponse[InvoiceScheduleResponse]:
        """Update an invoice schedule

        Updates a pending invoice schedule.  You can use this API operation to update invoice schedules in the following aspects: - Update notes and pending invoice schedule items - Update orders associated with invoice schedules - Remove or add invoice schedule items  For more samples, see [Edit invoice schedules](https://knowledgecenter.zuora.com/Billing/Billing_and_Payments/Billing_Schedule/Billing_Schedule_tutorials/Edit_invoice_schedules).  ### Restrictions and limitations   When updating invoice schedules through the REST API, keep the following restrictions and limitations in mind: - You can only update invoice schedule items in Pending status. - You can only add orders or specific subscriptions to pending invoice schedules, and remove orders or specific subscriptions from pending invoice schedules. - For the invoice schedule items that you want to update, you must include the new values for these items in the request. - For the invoice schedule items that you want to keep unchanged, you must include all the existing information about these items in the request. Otherwise, the existing invoice schedule items that you do not mention in the request are deleted. - For the orders that you want to keep unchanged for an invoice schedule, you must include all the existing order numbers associated with the invoice schedule in the request. Otherwise, the existing orders that you do not mention in the request are removed. 

        :param schedule_key: The unique ID or number of the invoice schedule to be updated. For example, 2c92c8955bd63cc1015bd7c151af02ab or IS-0000001.  (required)
        :type schedule_key: str
        :param request: (required)
        :type request: UpdateInvoiceScheduleRequest
        :param accept_encoding: Include the `Accept-Encoding: gzip` header to compress responses as a gzipped file. It can significantly reduce the bandwidth required for a response.   If specified, Zuora automatically compresses responses that contain over 1000 bytes of data, and the response contains a `Content-Encoding` header with the compression algorithm so that your client can decompress it. 
        :type accept_encoding: str
        :param content_encoding: Include the `Content-Encoding: gzip` header to compress a request. With this header specified, you should upload a gzipped file for the request payload instead of sending the JSON payload. 
        :type content_encoding: str
        :param authorization: The value is in the `Bearer {token}` format where {token} is a valid OAuth token generated by calling [Create an OAuth token](https://www.zuora.com/developer/api-references/api/operation/createToken). 
        :type authorization: str
        :param zuora_track_id: A custom identifier for tracing the API call. If you set a value for this header, Zuora returns the same value in the response headers. This header enables you to associate your system process identifiers with Zuora API calls, to assist with troubleshooting in the event of an issue.  The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (`:`), semicolon (`;`), double quote (`\"`), and quote (`'`). 
        :type zuora_track_id: str
        :param zuora_entity_ids: An entity ID. If you have [Zuora Multi-entity](https://knowledgecenter.zuora.com/BB_Introducing_Z_Business/Multi-entity) enabled and the OAuth token is valid for more than one entity, you must use this header to specify which entity to perform the operation in. If the OAuth token is only valid for a single entity, or you do not have Zuora Multi-entity enabled, you do not need to set this header. 
        :type zuora_entity_ids: str
        :param zuora_version: The minor version of the Zuora REST API.  
        :type zuora_version: str
        :param zuora_org_ids: Comma separated IDs. If you have Zuora Multi-Org enabled, you can use this header to specify which orgs to perform the operation in. If you do not have Zuora Multi-Org enabled, you should not set this header. The IDs must be a sub-set of the user's accessible orgs. If you specify an org that the user does not have access to, the operation fails. If the header is not set, the operation is performed in scope of the user's accessible orgs. 
        :type zuora_org_ids: str
        :param _request_timeout: timeout setting for this request. If one
                                 number provided, it will be total request
                                 timeout. It can also be a pair (tuple) of
                                 (connection, read) timeouts.
        :type _request_timeout: int, tuple(int, int), optional
        :param _request_auth: set to override the auth_settings for an a single
                              request; this effectively ignores the
                              authentication in the spec for a single request.
        :type _request_auth: dict, optional
        :param _content_type: force content-type for the request.
        :type _content_type: str, Optional
        :param _headers: set to override the headers for a single
                         request; this effectively ignores the headers
                         in the spec for a single request.
        :type _headers: dict, optional
        :param _host_index: set to override the host_index for a single
                            request; this effectively ignores the host_index
                            in the spec for a single request.
        :type _host_index: int, optional
        :return: Returns the result object.
        """ # noqa: E501

        _param = self._update_invoice_schedule_serialize(
            schedule_key=schedule_key,
            request=request,
            accept_encoding=accept_encoding,
            content_encoding=content_encoding,
            authorization=authorization,
            zuora_track_id=zuora_track_id,
            zuora_entity_ids=zuora_entity_ids,
            zuora_version=zuora_version,
            zuora_org_ids=zuora_org_ids,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "InvoiceScheduleResponse",
            '400': "CommonResponse",
            '401': "ProxyUnauthorizedResponse",
            '403': "CommonErrorResponse",
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        response_data.read()
        return self.api_client.response_deserialize(
            response_data=response_data,
            response_types_map=_response_types_map,
        )

    def _update_invoice_schedule_serialize(
        self,
        schedule_key,
        request,
        accept_encoding,
        content_encoding,
        authorization,
        zuora_track_id,
        zuora_entity_ids,
        zuora_version,
        zuora_org_ids,
        _request_auth,
        _content_type,
        _headers,
        _host_index,
    ) -> RequestSerialized:

        _host = None

        _collection_formats: Dict[str, str] = {
        }

        _path_params: Dict[str, str] = {}
        _query_params: List[Tuple[str, str]] = []
        _header_params: Dict[str, Optional[str]] = _headers or {}
        _form_params: List[Tuple[str, str]] = []
        _files: Dict[
            str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
        ] = {}
        _body_params: Optional[bytes] = None

        # process the path parameters
        if schedule_key is not None:
            _path_params['scheduleKey'] = schedule_key
        # process the query parameters
        # process the header parameters
        if accept_encoding is not None:
            _header_params['Accept-Encoding'] = accept_encoding
        if content_encoding is not None:
            _header_params['Content-Encoding'] = content_encoding
        if authorization is not None:
            _header_params['Authorization'] = authorization
        if zuora_track_id is not None:
            _header_params['Zuora-Track-Id'] = zuora_track_id
        if zuora_entity_ids is not None:
            _header_params['Zuora-Entity-Ids'] = zuora_entity_ids
        if zuora_version is not None:
            _header_params['Zuora-Version'] = zuora_version
        if zuora_org_ids is not None:
            _header_params['Zuora-Org-Ids'] = zuora_org_ids
        # process the form parameters
        # process the body parameter
        if request is not None:
            _body_params = request


        # set the HTTP header `Accept`
        if 'Accept' not in _header_params:
            _header_params['Accept'] = self.api_client.select_header_accept(
                [
                    'application/json'
                ]
            )

        # set the HTTP header `Content-Type`
        if _content_type:
            _header_params['Content-Type'] = _content_type
        else:
            _default_content_type = (
                self.api_client.select_header_content_type(
                    [
                        'application/json'
                    ]
                )
            )
            if _default_content_type is not None:
                _header_params['Content-Type'] = _default_content_type

        # authentication setting
        _auth_settings: List[str] = [
            'bearerAuth'
        ]

        return self.api_client.param_serialize(
            method='PUT',
            resource_path='/v1/invoice-schedules/{scheduleKey}',
            path_params=_path_params,
            query_params=_query_params,
            header_params=_header_params,
            body=_body_params,
            post_params=_form_params,
            files=_files,
            auth_settings=_auth_settings,
            collection_formats=_collection_formats,
            _host=_host,
            _request_auth=_request_auth
        )


