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

from .base_api_module import BaseApiModule


class AssetsApiModule(BaseApiModule):
    def list(self, params=None, **kwargs):
        """
        Returns an array of assets.

        :param dict params: app_key: string
        asset_condition: string
        asset_condition__in: string
        asset_id: string
        asset_path: string
        asset_path_cache__path: string
        asset_path_search: string
        asset_type__in: string
        created_on: string
        deactivated_on: string
        descendants: string
        description: string
        external_id: string
        geo_point__bounding_box: string
        is_active: string
        labels: string
        limit: integer
        manufacturer: string
        model: string
        name: string
        no_parent: string
        offset: integer
        ordering: string
        owner: string
        owner__in: string
        owner__name: string
        parent: string
        parent__in: string
        related: string
        search: string
        serial_number: string
        type: string
        type__name: string
        updated_on: 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/AssetDetail'
            type: array
        required:
        - count
        - results
        type: object

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

    def create(self, json=None, **kwargs):
        """
        accept a flat object for create, return nested detail object

        :param dict json: $ref: '#/components/schemas/AssetCreate'

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

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

    def asset_condition_map(self, params=None, **kwargs):
        """
        Asset endpoint


        :param dict params: app_key: string
        asset_condition: string
        asset_condition__in: string
        asset_id: string
        asset_path: string
        asset_path_cache__path: string
        asset_path_search: string
        asset_type__in: string
        created_on: string
        deactivated_on: string
        descendants: string
        description: string
        external_id: string
        geo_point__bounding_box: string
        is_active: string
        labels: string
        limit: integer
        manufacturer: string
        model: string
        name: string
        no_parent: string
        offset: integer
        ordering: string
        owner: string
        owner__in: string
        owner__name: string
        parent: string
        parent__in: string
        related: string
        search: string
        serial_number: string
        type: string
        type__name: string
        updated_on: string

        :returns: items:
          $ref: '#/components/schemas/AssetConditionMap'
        type: array

        https://docs.huvrdata.app/reference/api_assets_asset_condition_map
        """
        return self.client.request_json(
            method="get",
            path=f"/api/assets/asset-condition-map/",
            params=params,
            **kwargs,
        )

    def filters(self, params=None, **kwargs):
        """
        No query parameters are supported on this endpoint.

        :param dict params: app_key: string
        asset_condition: string
        asset_condition__in: string
        asset_id: string
        asset_path: string
        asset_path_cache__path: string
        asset_path_search: string
        asset_type__in: string
        created_on: string
        deactivated_on: string
        descendants: string
        description: string
        external_id: string
        geo_point__bounding_box: string
        is_active: string
        labels: string
        limit: integer
        manufacturer: string
        model: string
        name: string
        no_parent: string
        offset: integer
        ordering: string
        owner: string
        owner__in: string
        owner__name: string
        parent: string
        parent__in: string
        related: string
        search: string
        serial_number: string
        type: string
        type__name: string
        updated_on: string

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

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

    def tree(self, params=None, **kwargs):
        """
        Asset endpoint


        :param dict params: app_key: string
        asset_condition: string
        asset_condition__in: string
        asset_id: string
        asset_path: string
        asset_path_cache__path: string
        asset_path_search: string
        asset_type__in: string
        created_on: string
        deactivated_on: string
        descendants: string
        description: string
        external_id: string
        geo_point__bounding_box: string
        is_active: string
        labels: string
        limit: integer
        manufacturer: string
        model: string
        name: string
        no_parent: string
        offset: integer
        ordering: string
        owner: string
        owner__in: string
        owner__name: string
        parent: string
        parent__in: string
        related: string
        search: string
        serial_number: string
        type: string
        type__name: string
        updated_on: 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/AssetDetail'
            type: array
        required:
        - count
        - results
        type: object

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

    def read(self, id, **kwargs):
        """
        Return the specific asset
        :params id asset ID

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

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

    def update(self, id, json=None, **kwargs):
        """
        Asset update. Asset type and asset path are ignored on updates

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

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

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

    def partial_update(self, id, json=None, **kwargs):
        """
        Asset endpoint


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

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

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

    def delete(self, id, **kwargs):
        """
        Asset endpoint

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