From e4d491fc25393e9b26a1c96ba8f457bb4fd1499b Mon Sep 17 00:00:00 2001 From: Ted Chambers Date: Fri, 15 Feb 2019 12:06:10 -0500 Subject: [PATCH] add missing git_client --- .../azure/devops/v5_0/git/git_client.py | 45 +++++++++++++++++++ .../azure/devops/v5_1/git/git_client.py | 45 +++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 azure-devops/azure/devops/v5_0/git/git_client.py create mode 100644 azure-devops/azure/devops/v5_1/git/git_client.py diff --git a/azure-devops/azure/devops/v5_0/git/git_client.py b/azure-devops/azure/devops/v5_0/git/git_client.py new file mode 100644 index 0000000..83c449c --- /dev/null +++ b/azure-devops/azure/devops/v5_0/git/git_client.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Generated file, DO NOT EDIT +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + + +from msrest.universal_http import ClientRequest +from .git_client_base import GitClientBase + + +class GitClient(GitClientBase): + """Git + :param str base_url: Service URL + :param Authentication creds: Authenticated credentials. + """ + + def __init__(self, base_url=None, creds=None): + super(GitClient, self).__init__(base_url, creds) + + def get_vsts_info(self, relative_remote_url): + url = self._client.format_url(relative_remote_url.rstrip('/') + '/vsts/info') + request = ClientRequest(method='GET', url=url) + headers = {'Accept': 'application/json'} + if self._suppress_fedauth_redirect: + headers['X-TFS-FedAuthRedirect'] = 'Suppress' + if self._force_msa_pass_through: + headers['X-VSS-ForceMsaPassThrough'] = 'true' + response = self._send_request(request, headers) + return self._deserialize('VstsInfo', response) + + @staticmethod + def get_vsts_info_by_remote_url(remote_url, credentials, + suppress_fedauth_redirect=True, + force_msa_pass_through=True): + request = ClientRequest(method='GET', url=remote_url.rstrip('/') + '/vsts/info') + headers = {'Accept': 'application/json'} + if suppress_fedauth_redirect: + headers['X-TFS-FedAuthRedirect'] = 'Suppress' + if force_msa_pass_through: + headers['X-VSS-ForceMsaPassThrough'] = 'true' + git_client = GitClient(base_url=remote_url, creds=credentials) + response = git_client._send_request(request, headers) + return git_client._deserialize('VstsInfo', response) diff --git a/azure-devops/azure/devops/v5_1/git/git_client.py b/azure-devops/azure/devops/v5_1/git/git_client.py new file mode 100644 index 0000000..83c449c --- /dev/null +++ b/azure-devops/azure/devops/v5_1/git/git_client.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Generated file, DO NOT EDIT +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + + +from msrest.universal_http import ClientRequest +from .git_client_base import GitClientBase + + +class GitClient(GitClientBase): + """Git + :param str base_url: Service URL + :param Authentication creds: Authenticated credentials. + """ + + def __init__(self, base_url=None, creds=None): + super(GitClient, self).__init__(base_url, creds) + + def get_vsts_info(self, relative_remote_url): + url = self._client.format_url(relative_remote_url.rstrip('/') + '/vsts/info') + request = ClientRequest(method='GET', url=url) + headers = {'Accept': 'application/json'} + if self._suppress_fedauth_redirect: + headers['X-TFS-FedAuthRedirect'] = 'Suppress' + if self._force_msa_pass_through: + headers['X-VSS-ForceMsaPassThrough'] = 'true' + response = self._send_request(request, headers) + return self._deserialize('VstsInfo', response) + + @staticmethod + def get_vsts_info_by_remote_url(remote_url, credentials, + suppress_fedauth_redirect=True, + force_msa_pass_through=True): + request = ClientRequest(method='GET', url=remote_url.rstrip('/') + '/vsts/info') + headers = {'Accept': 'application/json'} + if suppress_fedauth_redirect: + headers['X-TFS-FedAuthRedirect'] = 'Suppress' + if force_msa_pass_through: + headers['X-VSS-ForceMsaPassThrough'] = 'true' + git_client = GitClient(base_url=remote_url, creds=credentials) + response = git_client._send_request(request, headers) + return git_client._deserialize('VstsInfo', response)