# coding: utf-8

"""
    Wrk Automation Platform - API v1

    The Wrk API is organized around REST. Our API has predictable resource-oriented URLs, accepts and returns JSON-encoded requests and responses. It uses standard HTTP response codes, authentication, and verbs.  Please note you need will an API key with the appropriate access to use the following APIs. The API key can be obtained from [this page](https://account.wrk.com/api-key) in your Wrk account. To elevate access to your account, please [contact your Sales team](https://www.wrk.com/meet-automation-expert).

    The version of the OpenAPI document: 2.4.0
    Contact: support@wrk.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, StrictFloat, StrictInt, StrictStr, field_validator
from typing import Optional, Union
from typing_extensions import Annotated
from wrk_platform_sdk.models.get_launch_activities200_response import GetLaunchActivities200Response

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


class LaunchActivitiesApi:
    """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 get_launch_activities(
        self,
        launch_id: StrictStr,
        page_token: Annotated[Optional[StrictStr], Field(description="The page token used for keyset-based pagination. Defaults to the first entry based on the sort order.")] = None,
        page_size: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The page size used for pagination. Defaults to 50.")] = None,
        sort_order: Annotated[Optional[StrictStr], Field(description="The sort order. Defaults to descending.")] = 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,
    ) -> GetLaunchActivities200Response:
        """Get Wrkflow Launch Activities


        :param launch_id: (required)
        :type launch_id: str
        :param page_token: The page token used for keyset-based pagination. Defaults to the first entry based on the sort order.
        :type page_token: str
        :param page_size: The page size used for pagination. Defaults to 50.
        :type page_size: float
        :param sort_order: The sort order. Defaults to descending.
        :type sort_order: 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_launch_activities_serialize(
            launch_id=launch_id,
            page_token=page_token,
            page_size=page_size,
            sort_order=sort_order,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GetLaunchActivities200Response",
            '404': None,
        }
        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_launch_activities_with_http_info(
        self,
        launch_id: StrictStr,
        page_token: Annotated[Optional[StrictStr], Field(description="The page token used for keyset-based pagination. Defaults to the first entry based on the sort order.")] = None,
        page_size: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The page size used for pagination. Defaults to 50.")] = None,
        sort_order: Annotated[Optional[StrictStr], Field(description="The sort order. Defaults to descending.")] = 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[GetLaunchActivities200Response]:
        """Get Wrkflow Launch Activities


        :param launch_id: (required)
        :type launch_id: str
        :param page_token: The page token used for keyset-based pagination. Defaults to the first entry based on the sort order.
        :type page_token: str
        :param page_size: The page size used for pagination. Defaults to 50.
        :type page_size: float
        :param sort_order: The sort order. Defaults to descending.
        :type sort_order: 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_launch_activities_serialize(
            launch_id=launch_id,
            page_token=page_token,
            page_size=page_size,
            sort_order=sort_order,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GetLaunchActivities200Response",
            '404': None,
        }
        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,
        )


    @validate_call
    def get_launch_activities_without_preload_content(
        self,
        launch_id: StrictStr,
        page_token: Annotated[Optional[StrictStr], Field(description="The page token used for keyset-based pagination. Defaults to the first entry based on the sort order.")] = None,
        page_size: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="The page size used for pagination. Defaults to 50.")] = None,
        sort_order: Annotated[Optional[StrictStr], Field(description="The sort order. Defaults to descending.")] = 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,
    ) -> RESTResponseType:
        """Get Wrkflow Launch Activities


        :param launch_id: (required)
        :type launch_id: str
        :param page_token: The page token used for keyset-based pagination. Defaults to the first entry based on the sort order.
        :type page_token: str
        :param page_size: The page size used for pagination. Defaults to 50.
        :type page_size: float
        :param sort_order: The sort order. Defaults to descending.
        :type sort_order: 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_launch_activities_serialize(
            launch_id=launch_id,
            page_token=page_token,
            page_size=page_size,
            sort_order=sort_order,
            _request_auth=_request_auth,
            _content_type=_content_type,
            _headers=_headers,
            _host_index=_host_index
        )

        _response_types_map: Dict[str, Optional[str]] = {
            '200': "GetLaunchActivities200Response",
            '404': None,
        }
        response_data = self.api_client.call_api(
            *_param,
            _request_timeout=_request_timeout
        )
        return response_data.response


    def _get_launch_activities_serialize(
        self,
        launch_id,
        page_token,
        page_size,
        sort_order,
        _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 launch_id is not None:
            _path_params['launch_id'] = launch_id
        # process the query parameters
        if page_token is not None:
            
            _query_params.append(('page_token', page_token))
            
        if page_size is not None:
            
            _query_params.append(('page_size', page_size))
            
        if sort_order is not None:
            
            _query_params.append(('sort_order', sort_order))
            
        # process the header parameters
        # 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] = [
            'ApiKeyAuth'
        ]

        return self.api_client.param_serialize(
            method='GET',
            resource_path='/launch/{launch_id}/activity',
            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
        )


