# Code generated by Lark OpenAPI.

from typing import Optional

from lark_oapi.core.construct import init


class GlAccountCompanyRelationship(object):
    _types = {
        "gl_account_code": str,
        "company_code": str,
        "gl_account_company_relationship_uid": str,
        "valid_to": str,
    }

    def __init__(self, d=None):
        self.gl_account_code: Optional[str] = None
        self.company_code: Optional[str] = None
        self.gl_account_company_relationship_uid: Optional[str] = None
        self.valid_to: Optional[str] = None
        init(self, d, self._types)

    @staticmethod
    def builder() -> "GlAccountCompanyRelationshipBuilder":
        return GlAccountCompanyRelationshipBuilder()


class GlAccountCompanyRelationshipBuilder(object):
    def __init__(self) -> None:
        self._gl_account_company_relationship = GlAccountCompanyRelationship()

    def gl_account_code(self, gl_account_code: str) -> "GlAccountCompanyRelationshipBuilder":
        self._gl_account_company_relationship.gl_account_code = gl_account_code
        return self

    def company_code(self, company_code: str) -> "GlAccountCompanyRelationshipBuilder":
        self._gl_account_company_relationship.company_code = company_code
        return self

    def gl_account_company_relationship_uid(self,
                                            gl_account_company_relationship_uid: str) -> "GlAccountCompanyRelationshipBuilder":
        self._gl_account_company_relationship.gl_account_company_relationship_uid = gl_account_company_relationship_uid
        return self

    def valid_to(self, valid_to: str) -> "GlAccountCompanyRelationshipBuilder":
        self._gl_account_company_relationship.valid_to = valid_to
        return self

    def build(self) -> "GlAccountCompanyRelationship":
        return self._gl_account_company_relationship
