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

from .base_api_module import BaseApiModule


class CompaniesApiModule(BaseApiModule):
    def list(self, params=None, **kwargs):
        """
        Returns an array companies.

        :param dict params: is_active: string
        limit: integer
        name: string
        offset: integer
        ordering: string
        role: 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/Company'
            type: array
        required:
        - count
        - results
        type: object

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

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


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

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

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

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

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

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

    def update(self, id, json=None, **kwargs):
        """
        company update

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

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

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

    def partial_update(self, id, json=None, **kwargs):
        """
        View companies


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

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

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

    def delete(self, id, **kwargs):
        """
        View companies

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