# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# See https://github.com/eolymp/contracts/tree/main/cmd/protoc-gen-python-esdk for more details.
"""Generated protocol buffer code."""

import urllib.parse
from google.protobuf import symbol_database as _symbol_database

_sym_db = _symbol_database.Default()


class CommunityClient:
    def __init__(self, transport, url="https://api.eolymp.com"):
        self.transport = transport
        self.url = url

    def JoinSpace(self, request, **kwargs):
        path = "/members/_self"

        return self.transport.request(
            name="eolymp.community.Community/JoinSpace",
            method="POST",
            url=self.url+path,
            path=path,
            request_data=request,
            response_symbol=_sym_db.GetSymbol("eolymp.community.JoinSpaceOutput"),
            **kwargs,
        )

    def LeaveSpace(self, request, **kwargs):
        path = "/members/_self"

        return self.transport.request(
            name="eolymp.community.Community/LeaveSpace",
            method="DELETE",
            url=self.url+path,
            path=path,
            request_data=request,
            response_symbol=_sym_db.GetSymbol("eolymp.community.LeaveSpaceOutput"),
            **kwargs,
        )

    def RegisterMember(self, request, **kwargs):
        path = "/members/_self/attributes"

        return self.transport.request(
            name="eolymp.community.Community/RegisterMember",
            method="POST",
            url=self.url+path,
            path=path,
            request_data=request,
            response_symbol=_sym_db.GetSymbol("eolymp.community.RegisterMemberOutput"),
            **kwargs,
        )

    def IntrospectMember(self, request, **kwargs):
        path = "/members/_self"

        return self.transport.request(
            name="eolymp.community.Community/IntrospectMember",
            method="GET",
            url=self.url+path,
            path=path,
            request_data=request,
            response_symbol=_sym_db.GetSymbol("eolymp.community.IntrospectMemberOutput"),
            **kwargs,
        )

    def AddMember(self, request, **kwargs):
        path = "/members"

        return self.transport.request(
            name="eolymp.community.Community/AddMember",
            method="POST",
            url=self.url+path,
            path=path,
            request_data=request,
            response_symbol=_sym_db.GetSymbol("eolymp.community.AddMemberOutput"),
            **kwargs,
        )

    def UpdateMember(self, request, **kwargs):
        path = "/members/"+urllib.parse.quote(request.member_id)

        # Cleanup URL parameters to avoid any ambiguity
        request.member_id = ""

        return self.transport.request(
            name="eolymp.community.Community/UpdateMember",
            method="POST",
            url=self.url+path,
            path=path,
            request_data=request,
            response_symbol=_sym_db.GetSymbol("eolymp.community.UpdateMemberOutput"),
            **kwargs,
        )

    def RemoveMember(self, request, **kwargs):
        path = "/members/"+urllib.parse.quote(request.member_id)

        # Cleanup URL parameters to avoid any ambiguity
        request.member_id = ""

        return self.transport.request(
            name="eolymp.community.Community/RemoveMember",
            method="DELETE",
            url=self.url+path,
            path=path,
            request_data=request,
            response_symbol=_sym_db.GetSymbol("eolymp.community.RemoveMemberOutput"),
            **kwargs,
        )

    def DescribeMember(self, request, **kwargs):
        path = "/members/"+urllib.parse.quote(request.member_id)

        # Cleanup URL parameters to avoid any ambiguity
        request.member_id = ""

        return self.transport.request(
            name="eolymp.community.Community/DescribeMember",
            method="GET",
            url=self.url+path,
            path=path,
            request_data=request,
            response_symbol=_sym_db.GetSymbol("eolymp.community.DescribeMemberOutput"),
            **kwargs,
        )

    def ListMembers(self, request, **kwargs):
        path = "/members"

        return self.transport.request(
            name="eolymp.community.Community/ListMembers",
            method="GET",
            url=self.url+path,
            path=path,
            request_data=request,
            response_symbol=_sym_db.GetSymbol("eolymp.community.ListMembersOutput"),
            **kwargs,
        )

    def AddMemberIdentity(self, request, **kwargs):
        path = "/members/"+urllib.parse.quote(request.member_id)+"/identities"

        # Cleanup URL parameters to avoid any ambiguity
        request.member_id = ""

        return self.transport.request(
            name="eolymp.community.Community/AddMemberIdentity",
            method="POST",
            url=self.url+path,
            path=path,
            request_data=request,
            response_symbol=_sym_db.GetSymbol("eolymp.community.AddMemberIdentityOutput"),
            **kwargs,
        )

    def UpdateMemberIdentity(self, request, **kwargs):
        path = "/members/"+urllib.parse.quote(request.member_id)+"/identities/"+urllib.parse.quote(request.identity_id)

        # Cleanup URL parameters to avoid any ambiguity
        request.member_id = ""
        request.identity_id = ""

        return self.transport.request(
            name="eolymp.community.Community/UpdateMemberIdentity",
            method="PUT",
            url=self.url+path,
            path=path,
            request_data=request,
            response_symbol=_sym_db.GetSymbol("eolymp.community.UpdateMemberIdentityOutput"),
            **kwargs,
        )

    def RemoveMemberIdentity(self, request, **kwargs):
        path = "/members/"+urllib.parse.quote(request.member_id)+"/identities/"+urllib.parse.quote(request.identity_id)

        # Cleanup URL parameters to avoid any ambiguity
        request.member_id = ""
        request.identity_id = ""

        return self.transport.request(
            name="eolymp.community.Community/RemoveMemberIdentity",
            method="DELETE",
            url=self.url+path,
            path=path,
            request_data=request,
            response_symbol=_sym_db.GetSymbol("eolymp.community.RemoveMemberIdentityOutput"),
            **kwargs,
        )

    def AddAttribute(self, request, **kwargs):
        path = "/attributes"

        return self.transport.request(
            name="eolymp.community.Community/AddAttribute",
            method="POST",
            url=self.url+path,
            path=path,
            request_data=request,
            response_symbol=_sym_db.GetSymbol("eolymp.community.AddAttributeOutput"),
            **kwargs,
        )

    def UpdateAttribute(self, request, **kwargs):
        path = "/attributes/"+urllib.parse.quote(request.attribute_key)

        # Cleanup URL parameters to avoid any ambiguity
        request.attribute_key = ""

        return self.transport.request(
            name="eolymp.community.Community/UpdateAttribute",
            method="POST",
            url=self.url+path,
            path=path,
            request_data=request,
            response_symbol=_sym_db.GetSymbol("eolymp.community.UpdateAttributeOutput"),
            **kwargs,
        )

    def RemoveAttribute(self, request, **kwargs):
        path = "/attributes/"+urllib.parse.quote(request.attribute_key)

        # Cleanup URL parameters to avoid any ambiguity
        request.attribute_key = ""

        return self.transport.request(
            name="eolymp.community.Community/RemoveAttribute",
            method="DELETE",
            url=self.url+path,
            path=path,
            request_data=request,
            response_symbol=_sym_db.GetSymbol("eolymp.community.RemoveAttributeOutput"),
            **kwargs,
        )

    def DescribeAttribute(self, request, **kwargs):
        path = "/attributes/"+urllib.parse.quote(request.attribute_key)

        # Cleanup URL parameters to avoid any ambiguity
        request.attribute_key = ""

        return self.transport.request(
            name="eolymp.community.Community/DescribeAttribute",
            method="GET",
            url=self.url+path,
            path=path,
            request_data=request,
            response_symbol=_sym_db.GetSymbol("eolymp.community.DescribeAttributeOutput"),
            **kwargs,
        )

    def ListAttributes(self, request, **kwargs):
        path = "/attributes"

        return self.transport.request(
            name="eolymp.community.Community/ListAttributes",
            method="GET",
            url=self.url+path,
            path=path,
            request_data=request,
            response_symbol=_sym_db.GetSymbol("eolymp.community.ListAttributesOutput"),
            **kwargs,
        )

    def DescribeIdentityProvider(self, request, **kwargs):
        path = "/idp"

        return self.transport.request(
            name="eolymp.community.Community/DescribeIdentityProvider",
            method="GET",
            url=self.url+path,
            path=path,
            request_data=request,
            response_symbol=_sym_db.GetSymbol("eolymp.community.DescribeIdentityProviderOutput"),
            **kwargs,
        )

    def ConfigureIdentityProvider(self, request, **kwargs):
        path = "/idp"

        return self.transport.request(
            name="eolymp.community.Community/ConfigureIdentityProvider",
            method="PUT",
            url=self.url+path,
            path=path,
            request_data=request,
            response_symbol=_sym_db.GetSymbol("eolymp.community.ConfigureIdentityProviderOutput"),
            **kwargs,
        )

