def archive_with_http_info(self, definition_id, app_id,
                               **kwargs):  # noqa: E501
        """Archive a custom action  # noqa: E501

        Archives a single custom workflow action with the specified ID. Workflows that currently use this custom action will stop attempting to execute the action, and all future executions will be marked as a failure.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.archive_with_http_info(definition_id, app_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str definition_id: The ID of the custom workflow action. (required)
        :param int app_id: (required)
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :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.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ["definition_id", "app_id"]
        all_params.extend([
            "async_req",
            "_return_http_data_only",
            "_preload_content",
            "_request_timeout",
        ])

        for key, val in six.iteritems(local_var_params["kwargs"]):
            if key not in all_params:
                raise ApiTypeError("Got an unexpected keyword argument '%s'"
                                   " to method archive" % key)
            local_var_params[key] = val
        del local_var_params["kwargs"]
        # verify the required parameter 'definition_id' is set
        if self.api_client.client_side_validation and (
                "definition_id" not in local_var_params
                or local_var_params["definition_id"] is None  # noqa: E501
        ):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `definition_id` when calling `archive`"
            )  # noqa: E501
        # verify the required parameter 'app_id' is set
        if self.api_client.client_side_validation and (
                "app_id" not in local_var_params
                or local_var_params["app_id"] is None  # noqa: E501
        ):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `app_id` when calling `archive`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}
        if "definition_id" in local_var_params:
            path_params["definitionId"] = local_var_params[
                "definition_id"]  # noqa: E501
        if "app_id" in local_var_params:
            path_params["appId"] = local_var_params["app_id"]  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params["Accept"] = self.api_client.select_header_accept(
            ["*/*"])  # noqa: E501

        # Authentication setting
        auth_settings = ["developer_hapikey"]  # noqa: E501

        return self.api_client.call_api(
            "/automation/v4/actions/{appId}/{definitionId}",
            "DELETE",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get("async_req"),
            _return_http_data_only=local_var_params.get(
                "_return_http_data_only"),  # noqa: E501
            _preload_content=local_var_params.get("_preload_content", True),
            _request_timeout=local_var_params.get("_request_timeout"),
            collection_formats=collection_formats,
        )
    def update_with_http_info(self, definition_id, app_id,
                              extension_action_definition_patch,
                              **kwargs):  # noqa: E501
        """Update a custom action  # noqa: E501

        Updates a custom workflow action with new values for the specified fields.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.update_with_http_info(definition_id, app_id, extension_action_definition_patch, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str definition_id: The ID of the custom workflow action. (required)
        :param int app_id: (required)
        :param ExtensionActionDefinitionPatch extension_action_definition_patch: The custom workflow action fields to be updated. (required)
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :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.
        :return: tuple(ExtensionActionDefinition, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = [
            "definition_id", "app_id", "extension_action_definition_patch"
        ]
        all_params.extend([
            "async_req",
            "_return_http_data_only",
            "_preload_content",
            "_request_timeout",
        ])

        for key, val in six.iteritems(local_var_params["kwargs"]):
            if key not in all_params:
                raise ApiTypeError("Got an unexpected keyword argument '%s'"
                                   " to method update" % key)
            local_var_params[key] = val
        del local_var_params["kwargs"]
        # verify the required parameter 'definition_id' is set
        if self.api_client.client_side_validation and (
                "definition_id" not in local_var_params
                or local_var_params["definition_id"] is None  # noqa: E501
        ):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `definition_id` when calling `update`"
            )  # noqa: E501
        # verify the required parameter 'app_id' is set
        if self.api_client.client_side_validation and (
                "app_id" not in local_var_params
                or local_var_params["app_id"] is None  # noqa: E501
        ):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `app_id` when calling `update`"
            )  # noqa: E501
        # verify the required parameter 'extension_action_definition_patch' is set
        if self.api_client.client_side_validation and (
                "extension_action_definition_patch" not in local_var_params
                or local_var_params[
                    "extension_action_definition_patch"]  # noqa: E501
                is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `extension_action_definition_patch` when calling `update`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}
        if "definition_id" in local_var_params:
            path_params["definitionId"] = local_var_params[
                "definition_id"]  # noqa: E501
        if "app_id" in local_var_params:
            path_params["appId"] = local_var_params["app_id"]  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if "extension_action_definition_patch" in local_var_params:
            body_params = local_var_params["extension_action_definition_patch"]
        # HTTP header `Accept`
        header_params["Accept"] = self.api_client.select_header_accept(
            ["application/json", "*/*"])  # noqa: E501

        # HTTP header `Content-Type`
        header_params[
            "Content-Type"] = self.api_client.select_header_content_type(  # noqa: E501
                ["application/json"])  # noqa: E501

        # Authentication setting
        auth_settings = ["developer_hapikey"]  # noqa: E501

        return self.api_client.call_api(
            "/automation/v4/actions/{appId}/{definitionId}",
            "PATCH",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type="ExtensionActionDefinition",  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get("async_req"),
            _return_http_data_only=local_var_params.get(
                "_return_http_data_only"),  # noqa: E501
            _preload_content=local_var_params.get("_preload_content", True),
            _request_timeout=local_var_params.get("_request_timeout"),
            collection_formats=collection_formats,
        )
    def get_page_with_http_info(self, app_id, **kwargs):  # noqa: E501
        """Get all custom actions  # noqa: E501

        Returns a list of all custom workflow actions.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_page_with_http_info(app_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param int app_id: (required)
        :param int limit: Maximum number of results per page.
        :param str after: The paging cursor token of the last successfully read resource will be returned as the `paging.next.after` JSON property of a paged response containing more results.
        :param bool archived: Whether to include archived custom actions.
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :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.
        :return: tuple(CollectionResponseExtensionActionDefinitionForwardPaging, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ["app_id", "limit", "after", "archived"]
        all_params.extend([
            "async_req",
            "_return_http_data_only",
            "_preload_content",
            "_request_timeout",
        ])

        for key, val in six.iteritems(local_var_params["kwargs"]):
            if key not in all_params:
                raise ApiTypeError("Got an unexpected keyword argument '%s'"
                                   " to method get_page" % key)
            local_var_params[key] = val
        del local_var_params["kwargs"]
        # verify the required parameter 'app_id' is set
        if self.api_client.client_side_validation and (
                "app_id" not in local_var_params
                or local_var_params["app_id"] is None  # noqa: E501
        ):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `app_id` when calling `get_page`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}
        if "app_id" in local_var_params:
            path_params["appId"] = local_var_params["app_id"]  # noqa: E501

        query_params = []
        if ("limit" in local_var_params
                and local_var_params["limit"] is not None):  # noqa: E501
            query_params.append(
                ("limit", local_var_params["limit"]))  # noqa: E501
        if ("after" in local_var_params
                and local_var_params["after"] is not None):  # noqa: E501
            query_params.append(
                ("after", local_var_params["after"]))  # noqa: E501
        if ("archived" in local_var_params
                and local_var_params["archived"] is not None):  # noqa: E501
            query_params.append(
                ("archived", local_var_params["archived"]))  # noqa: E501

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params["Accept"] = self.api_client.select_header_accept(
            ["application/json", "*/*"])  # noqa: E501

        # Authentication setting
        auth_settings = ["developer_hapikey"]  # noqa: E501

        return self.api_client.call_api(
            "/automation/v4/actions/{appId}",
            "GET",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=
            "CollectionResponseExtensionActionDefinitionForwardPaging",  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get("async_req"),
            _return_http_data_only=local_var_params.get(
                "_return_http_data_only"),  # noqa: E501
            _preload_content=local_var_params.get("_preload_content", True),
            _request_timeout=local_var_params.get("_request_timeout"),
            collection_formats=collection_formats,
        )
Exemple #4
0
    def complete_with_http_info(self, callback_id, callback_completion_request,
                                **kwargs):  # noqa: E501
        """Complete a callback  # noqa: E501

        Completes the given action callback.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.complete_with_http_info(callback_id, callback_completion_request, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str callback_id: The ID of the target app. (required)
        :param CallbackCompletionRequest callback_completion_request: The result of the completed action. (required)
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :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.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ["callback_id",
                      "callback_completion_request"]  # noqa: E501
        all_params.append("async_req")
        all_params.append("_return_http_data_only")
        all_params.append("_preload_content")
        all_params.append("_request_timeout")

        for key, val in six.iteritems(local_var_params["kwargs"]):
            if key not in all_params:
                raise ApiTypeError("Got an unexpected keyword argument '%s'"
                                   " to method complete" % key)
            local_var_params[key] = val
        del local_var_params["kwargs"]
        # verify the required parameter 'callback_id' is set
        if self.api_client.client_side_validation and (
                "callback_id" not in local_var_params
                or local_var_params["callback_id"] is None
        ):  # noqa: E501  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `callback_id` when calling `complete`"
            )  # noqa: E501
        # verify the required parameter 'callback_completion_request' is set
        if self.api_client.client_side_validation and (
                "callback_completion_request" not in local_var_params
                or local_var_params["callback_completion_request"] is None
        ):  # noqa: E501  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `callback_completion_request` when calling `complete`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}
        if "callback_id" in local_var_params:
            path_params["callbackId"] = local_var_params[
                "callback_id"]  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if "callback_completion_request" in local_var_params:
            body_params = local_var_params["callback_completion_request"]
        # HTTP header `Accept`
        header_params["Accept"] = self.api_client.select_header_accept(
            ["*/*"])  # noqa: E501

        # HTTP header `Content-Type`
        header_params[
            "Content-Type"] = self.api_client.select_header_content_type(
                ["application/json"])  # noqa: E501  # noqa: E501

        # Authentication setting
        auth_settings = ["hapikey", "oauth2"]  # noqa: E501

        return self.api_client.call_api(
            "/automation/v4/actions/callbacks/{callbackId}/complete",
            "POST",
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get("async_req"),
            _return_http_data_only=local_var_params.get(
                "_return_http_data_only"),  # noqa: E501
            _preload_content=local_var_params.get("_preload_content", True),
            _request_timeout=local_var_params.get("_request_timeout"),
            collection_formats=collection_formats,
        )
Exemple #5
0
    def get_by_id_with_http_info(self, definition_id, revision_id, app_id,
                                 **kwargs):  # noqa: E501
        """Get a revision for a custom action  # noqa: E501

        Returns the given version of a custom workflow action.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.get_by_id_with_http_info(definition_id, revision_id, app_id, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param str definition_id: The ID of the custom workflow action. (required)
        :param str revision_id: The version of the custom workflow action. (required)
        :param int app_id: (required)
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :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.
        :return: tuple(ActionRevision, status_code(int), headers(HTTPHeaderDict))
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['definition_id', 'revision_id', 'app_id']
        all_params.extend([
            'async_req', '_return_http_data_only', '_preload_content',
            '_request_timeout'
        ])

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError("Got an unexpected keyword argument '%s'"
                                   " to method get_by_id" % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'definition_id' is set
        if self.api_client.client_side_validation and (
                'definition_id' not in local_var_params or  # noqa: E501
                local_var_params['definition_id'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `definition_id` when calling `get_by_id`"
            )  # noqa: E501
        # verify the required parameter 'revision_id' is set
        if self.api_client.client_side_validation and (
                'revision_id' not in local_var_params or  # noqa: E501
                local_var_params['revision_id'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `revision_id` when calling `get_by_id`"
            )  # noqa: E501
        # verify the required parameter 'app_id' is set
        if self.api_client.client_side_validation and (
                'app_id' not in local_var_params or  # noqa: E501
                local_var_params['app_id'] is None):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `app_id` when calling `get_by_id`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}
        if 'definition_id' in local_var_params:
            path_params['definitionId'] = local_var_params[
                'definition_id']  # noqa: E501
        if 'revision_id' in local_var_params:
            path_params['revisionId'] = local_var_params[
                'revision_id']  # noqa: E501
        if 'app_id' in local_var_params:
            path_params['appId'] = local_var_params['app_id']  # noqa: E501

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['application/json', '*/*'])  # noqa: E501

        # Authentication setting
        auth_settings = ['developer_hapikey']  # noqa: E501

        return self.api_client.call_api(
            '/automation/v4/actions/{appId}/{definitionId}/revisions/{revisionId}',
            'GET',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type='ActionRevision',  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get(
                '_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)
Exemple #6
0
    def complete_batch_with_http_info(
            self, batch_input_callback_completion_batch_request,
            **kwargs):  # noqa: E501
        """Complete a batch of callbacks  # noqa: E501

        Completes the given action callbacks.  # noqa: E501
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please pass async_req=True
        >>> thread = api.complete_batch_with_http_info(batch_input_callback_completion_batch_request, async_req=True)
        >>> result = thread.get()

        :param async_req bool: execute request asynchronously
        :param BatchInputCallbackCompletionBatchRequest batch_input_callback_completion_batch_request: The result of the completed action. (required)
        :param _return_http_data_only: response data without head status code
                                       and headers
        :param _preload_content: if False, the urllib3.HTTPResponse object will
                                 be returned without reading/decoding response
                                 data. Default is True.
        :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.
        :return: None
                 If the method is called asynchronously,
                 returns the request thread.
        """

        local_var_params = locals()

        all_params = ['batch_input_callback_completion_batch_request']
        all_params.extend([
            'async_req', '_return_http_data_only', '_preload_content',
            '_request_timeout'
        ])

        for key, val in six.iteritems(local_var_params['kwargs']):
            if key not in all_params:
                raise ApiTypeError("Got an unexpected keyword argument '%s'"
                                   " to method complete_batch" % key)
            local_var_params[key] = val
        del local_var_params['kwargs']
        # verify the required parameter 'batch_input_callback_completion_batch_request' is set
        if self.api_client.client_side_validation and (
                'batch_input_callback_completion_batch_request'
                not in local_var_params or  # noqa: E501
                local_var_params[
                    'batch_input_callback_completion_batch_request'] is None
        ):  # noqa: E501
            raise ApiValueError(
                "Missing the required parameter `batch_input_callback_completion_batch_request` when calling `complete_batch`"
            )  # noqa: E501

        collection_formats = {}

        path_params = {}

        query_params = []

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        if 'batch_input_callback_completion_batch_request' in local_var_params:
            body_params = local_var_params[
                'batch_input_callback_completion_batch_request']
        # HTTP header `Accept`
        header_params['Accept'] = self.api_client.select_header_accept(
            ['*/*'])  # noqa: E501

        # HTTP header `Content-Type`
        header_params[
            'Content-Type'] = self.api_client.select_header_content_type(  # noqa: E501
                ['application/json'])  # noqa: E501

        # Authentication setting
        auth_settings = ['hapikey', 'oauth2']  # noqa: E501

        return self.api_client.call_api(
            '/automation/v4/actions/callbacks/complete',
            'POST',
            path_params,
            query_params,
            header_params,
            body=body_params,
            post_params=form_params,
            files=local_var_files,
            response_type=None,  # noqa: E501
            auth_settings=auth_settings,
            async_req=local_var_params.get('async_req'),
            _return_http_data_only=local_var_params.get(
                '_return_http_data_only'),  # noqa: E501
            _preload_content=local_var_params.get('_preload_content', True),
            _request_timeout=local_var_params.get('_request_timeout'),
            collection_formats=collection_formats)