"""
This file is automatically generated. Do not modify it manually.
"""

from .base_api_module import BaseApiModule


class CmlsApiModule(BaseApiModule):
    def list(self, params=None, **kwargs):
        """
        :param dict params: access_display: string
        app_key: string
        asset: string
        asset__asset_path_cache__path: string
        component_display: string
        created_on: string
        descendants: string
        external_id: string
        is_active: string
        limit: integer
        location_code_display: string
        measurements_summary__base: string
        measurements_summary__last: string
        measurements_summary__near: string
        name: string
        offset: integer
        ordering: string
        search: string
        type: string

        :returns: properties:
          count:
            type: integer
          next:
            format: uri
            nullable: true
            type: string
          previous:
            format: uri
            nullable: true
            type: string
          results:
            items:
              $ref: '#/components/schemas/CML'
            type: array
        required:
        - count
        - results
        type: object

        https://docs.huvrdata.app/reference/api_cmls_list
        """
        return self.client.request_json(
            method="get",
            path=f"/api/cmls/",
            params=params,
            **kwargs,
        )

    def create(self, json=None, **kwargs):
        """
        create CML

        :param dict json: $ref: '#/components/requestBodies/CMLCreate'

        :returns: $ref: '#/components/schemas/CML'

        https://docs.huvrdata.app/reference/api_cmls_create
        """
        return self.client.request_json(
            method="post",
            path=f"/api/cmls/",
            json=json,
            **kwargs,
        )

    def read(self, id, **kwargs):
        """
        :returns: $ref: '#/components/schemas/CML'

        https://docs.huvrdata.app/reference/api_cmls_read
        """
        return self.client.request_json(
            method="get",
            path=f"/api/cmls/{id}/",
            **kwargs,
        )

    def update(self, id, json=None, **kwargs):
        """
        :param dict json: $ref: '#/components/requestBodies/CMLCreate'

        :returns: $ref: '#/components/schemas/CML'

        https://docs.huvrdata.app/reference/api_cmls_update
        """
        return self.client.request_json(
            method="put",
            path=f"/api/cmls/{id}/",
            json=json,
            **kwargs,
        )

    def partial_update(self, id, json=None, **kwargs):
        """
        :param dict json: $ref: '#/components/requestBodies/CMLCreate'

        :returns: $ref: '#/components/schemas/CMLCreate'

        https://docs.huvrdata.app/reference/api_cmls_partial_update
        """
        return self.client.request_json(
            method="patch",
            path=f"/api/cmls/{id}/",
            json=json,
            **kwargs,
        )

    def delete(self, id, **kwargs):
        """
        https://docs.huvrdata.app/reference/api_cmls_delete
        """
        return self.client.request_json(
            method="delete",
            path=f"/api/cmls/{id}/",
            **kwargs,
        )
