List the media services in a subscription.

    Args:
        access_token (str): A valid Azure authentication token.
        subscription_id (str): Azure subscription id.

    Returns:
        HTTP response. JSON body.
495260
def list_media_services(access_token, subscription_id):
    '''
    '''
    endpoint = ''.join([get_rm_endpoint(),
                        '/subscriptions/', subscription_id,
                        '/providers/microsoft.media/mediaservices?api-version=', MEDIA_API])
    return do_get(endpoint, access_token)
552527
def get_subscription(self, subscription_id):
        
        url = self.SUBSCRIPTIONS_ID_URL % subscription_id

        connection = Connection(self.token)
        connection.set_url(self.production, url)

        return connection.get_request()
52006
def subscriptions_list_locations(subscription_id=None, **kwargs):
    '''
    

    '''
    result = {}

    if not subscription_id:
        subscription_id = kwargs.get('subscription_id')
    elif not kwargs.get('subscription_id'):
        kwargs['subscription_id'] = subscription_id

    subconn = __utils__['azurearm.get_client']('subscription', **kwargs)
    try:
        locations = __utils__['azurearm.paged_object_to_list'](
            subconn.subscriptions.list_locations(
                subscription_id=kwargs['subscription_id']
            )
        )

        for loc in locations:
            result[loc['name']] = loc
    except CloudError as exc:
        __utils__['azurearm.log_cloud_error']('resource', str(exc), **kwargs)
        result = {'error': str(exc)}

    return result
686469
def get_access_token(client_id, client_secret):
	'''
	
	'''

	headers = {'Content-Type': 'application/x-www-form-urlencoded'}
	payload = {
		'client_id': client_id,
		'client_secret': client_secret
	}

	request = requests.post(token_url, data=payload, headers=headers)
	if request.status_code == 200:
		token = request.json()
		return token

	return {'status': request.status_code, "message": request.text}
1262843
def request_access_token(self, access_code):
        ""
        token_response = request_session.post(
            "https://github.com/login/oauth/access_token",
            data={
                "client_id": self.oauth_client_id,
                "client_secret": self.oauth_client_secret,
                "code": access_code
            },
            headers={"Accept": "application/json"},
        )
        return helper_request_access_token(token_response.json())
1004566
public static Media mediaUploadvideo(String access_token, Uploadvideo uploadvideo) {
        return MediaAPI.mediaUploadvideo(access_token, uploadvideo);
    }
1328864
public static Media mediaUploadnews(String access_token, List<Article> articles) {
        return MediaAPI.mediaUploadnews(access_token, articles);
    }
577138
def introspect_access_token(self, access_token_value):
        # type: (str) -> Dict[str, Union[str, List[str]]]
        
        if access_token_value not in self.access_tokens:
            raise InvalidAccessToken('{} unknown'.format(access_token_value))

        authz_info = self.access_tokens[access_token_value]

        introspection = {'active': authz_info['exp'] >= int(time.time())}

        introspection_params = {k: v for k, v in authz_info.items() if k in TokenIntrospectionResponse.c_param}
        introspection.update(introspection_params)
        return introspection
642409
def get_access_token(self) -> str:
        
        if self._service_token:
            return self._service_token
        if self._app_id and self._login and self._password:
            try:
                if self.login():
                    url_params = self.auth_oauth2()
                    if 'access_token' in url_params:
                        return url_params['access_token']
            finally:
                self.close()
772931
def organization_subscriptions(self, organization_id, **kwargs):
        ""
        api_path = "/api/v2/organizations/{organization_id}/subscriptions.json"
        api_path = api_path.format(organization_id=organization_id)
        return self.call(api_path, **kwargs)
598251
def list_asgs_all(access_token, subscription_id):
    '''
    '''
    endpoint = ''.join([get_rm_endpoint(),
                        '/subscriptions/', subscription_id,
                        '/providers/Microsoft.Network/virtualNetworks/',
                        '?api-version=', NETWORK_API])
    return do_get(endpoint, access_token)
969899
def get_access_tokens(self, oauth_verifier):
        
        qb_service = OAuth1Service(
            consumer_key=self.consumer_key,
            consumer_secret=self.consumer_secret,
            request_token_url=self.request_token_url,
            access_token_url=self.access_token_url,
            authorize_url=self.authorize_url,
        )

        session = qb_service.get_auth_session(
            self.request_token,
            self.request_token_secret,
            data={'oauth_verifier': oauth_verifier})

        self.access_token = session.access_token
        self.access_token_secret = session.access_token_secret
        return session
1009692
function(subscription_id) {
    var params = {
      client_id:     this._credentials.client_id,
      client_secret: this._credentials.client_secret
    };
    if (subscription_id==='users') {
      params.object = 'user';
    } else if (subscription_id==='all') {
      params.object = 'all';
    } else {
      params.id = subscription_id;
    }
    return params;
  }
474184
def get_ams_access_token(accountname, accountkey):
    '''
    '''
    accountkey_encoded = urllib.parse.quote(accountkey, safe='')
    body = "grant_type=client_credentials&client_id=" + accountname + \
	"&client_secret=" + accountkey_encoded + " &scope=urn%3aWindowsAzureMediaServices"
    return do_ams_auth(ams_auth_endpoint, body)
1161206
def get_recurring_bill_by_subscription(self, subscription_id):
        
        params = {
            "subscriptionId": subscription_id,
        }
        return self.client._get(self.url + 'recurringBill', params=params, headers=self.get_headers())
262843
def get_list(client, list_id):
    '''  '''
    endpoint = '/'.join([client.api.Endpoints.LISTS, str(list_id)])
    response = client.authenticated_request(endpoint)
    return response.json()
1239
def get_authorized_tokens(self):
        
        resp, content = self.client.request(self.access_token_url, "GET")
        return dict(urlparse.parse_qsl(content))