#NEWLINE# def __init__( self , subdomain , username = None , password = None , access_token = None ) : #NEWLINE# #INDENT# '\n        Create a Zendesk service.\n\n        :var subdomain: The account-specific part of the Zendesk domain, for\n            instance use `mycompany` if your Zendesk domain is\n            `mycompany.zendesk.com`.\n        :vartype subdomain: str\n\n        :var username: The email of the authenticated agent. Use\n            `user@company.com/token` for token-based authentication.\n        :vartype username: str\n\n        :var password: The password of the authenticated agent, or an API token\n            if using token-based authentication.\n        :vartype password: str\n\n        :var access_token: An OAuth Access token. Username and password are not\n            required if the OAuth Access token is provided.\n        :vartype access_token: str\n        ' #NEWLINE# tmpl = '{0}.zendesk.com/api/v2' #NEWLINE# self . apiroot = http . quote_any ( tmpl . format ( port . to_u ( subdomain ) ) ) #NEWLINE# self . apiroot = ( 'https://' + self . apiroot ) #NEWLINE# if password : #NEWLINE# #INDENT# self . access_token = access_token #NEWLINE# self . add_filter ( self . add_authorization ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . add_filter ( auth . BasicAuth ( username , password ) ) #NEWLINE# #UNINDENT# self . add_filter ( self . use_json )