Access the aws

        :returns: twilio.rest.accounts.v1.credential.aws.AwsList
        :rtype: twilio.rest.accounts.v1.credential.aws.AwsList
505968
def aws(self):
        
        if self._aws is None:
            self._aws = AwsList(self._version, )
        return self._aws
1016603
def to_vars_dict(self):
        
        return {
            'aws_access_key_id':      self._access_key,
            'aws_secret_access_key':  self._secret_key,
            'aws_region':             self._region_name,
            'aws_vpc_name':           (self._vpc or ''),
            'aws_vpc_id':             (self._vpc_id or ''),
        }
31085
def _get_v4_signed_headers(self):
        """"""
        if self.aws_session is None:
            boto_session = session.Session()
            creds = boto_session.get_credentials()
        else:
            creds = self.aws_session.get_credentials()
        if creds is None:
            raise CerberusClientException("Unable to locate AWS credentials")
        readonly_credentials = creds.get_frozen_credentials()

        # hardcode get-caller-identity request
        data = OrderedDict((('Action','GetCallerIdentity'), ('Version', '2011-06-15')))
        url = 'https://sts.{}.amazonaws.com/'.format(self.region)
        request_object = awsrequest.AWSRequest(method='POST', url=url, data=data)

        signer = auth.SigV4Auth(readonly_credentials, 'sts', self.region)
        signer.add_auth(request_object)
        return request_object.headers
1244276
def get_current_user(self):
        
        if 'Authorization' in self.headers:
            match = self.access_key_regex.search(self.headers['Authorization'])
            if match:
                return match.group(1)

        if self.querystring.get('AWSAccessKeyId'):
            return self.querystring.get('AWSAccessKeyId')
        else:
            # Should we raise an unauthorized exception instead?
            return '111122223333'
1047104
def access_list(**kwargs):
    
    ctx = Context(**kwargs)
    ctx.execute_action('access:list', **{
        'unicorn': ctx.repo.create_secure_service('unicorn'),
    })
416179
def accounts(self):
        
        from ofxclient.account import Account
        client = self.client()
        query = client.account_list_query()
        resp = client.post(query)
        resp_handle = StringIO(resp)

        if IS_PYTHON_2:
            parsed = OfxParser.parse(resp_handle)
        else:
            parsed = OfxParser.parse(BytesIO(resp_handle.read().encode()))

        return [Account.from_ofxparse(a, institution=self)
                for a in parsed.accounts]
511317
def _get_credentials(self):
        
        uri = URITemplate(self.baseuri + '/{username}/credentials').expand(
            username=self.username)

        resp = self.session.post(uri)

        self.handle_http_error(
            resp,
            custom_messages={
                401: "Token is not authorized",
                404: "Token does not have upload scope",
                429: "Too many requests"})
        return resp
708825
def get_params(self):
        
        param_names = ['aws_access_key_id', 'aws_secret_access_key',
                       'is_secure', 'port', 'proxy', 'proxy_port',
                       'proxy_user', 'proxy_pass',
                       'debug', 'https_connection_factory']
        params = {}
        for name in param_names:
            params[name] = getattr(self, name)
        return params
1068093
def get_aws_creds(account, tenant, token):
    
    url = (FAWS_API_URL.format(account))
    headers = {
        'X-Auth-Token': token,
        'X-Tenant-Id': tenant,
    }
    response = requests.post(url, headers=headers,
                             json={'credential': {'duration': '3600'}})

    if not response.ok:
        sys.exit(FAWS_API_ERROR.format(response.status_code, response.text))
    return response.json()['credential']
215563
def get_limits(self):
        
        if self.limits != {}:
            return self.limits
        limits = {}
        limits['Groups'] = AwsLimit(
            'Groups',
            self,
            300,
            self.warning_threshold,
            self.critical_threshold,
            limit_type='AWS::IAM::Group',
        )
        limits['Users'] = AwsLimit(
            'Users',
            self,
            5000,
            self.warning_threshold,
            self.critical_threshold,
            limit_type='AWS::IAM::User',
        )
        limits['Roles'] = AwsLimit(
            'Roles',
            self,
            1000,
            self.warning_threshold,
            self.critical_threshold,
            limit_type='AWS::IAM::Role',
        )
        limits['Instance profiles'] = AwsLimit(
            'Instance profiles',
            self,
            1000,
            self.warning_threshold,
            self.critical_threshold,
            limit_type='AWS::IAM::InstanceProfile',
        )
        limits['Server certificates'] = AwsLimit(
            'Server certificates',
            self,
            20,
            self.warning_threshold,
            self.critical_threshold,
            limit_type='AWS::IAM::ServerCertificate',
        )
        limits['Policies'] = AwsLimit(
            'Policies',
            self,
            1500,
            self.warning_threshold,
            self.critical_threshold,
            limit_type='AWS::IAM::Policy',
        )
        limits['Policy Versions In Use'] = AwsLimit(
            'Policy Versions In Use',
            self,
            10000,
            self.warning_threshold,
            self.critical_threshold,
            limit_type='AWS::IAM::ServerCertificate',
        )
        self.limits = limits
        return limits
144018
def get(cls, credential_password_ip_id, permitted_ip_id,
            custom_headers=None):
        

        if custom_headers is None:
            custom_headers = {}

        api_client = client.ApiClient(cls._get_api_context())
        endpoint_url = cls._ENDPOINT_URL_READ.format(cls._determine_user_id(),
                                                     credential_password_ip_id,
                                                     permitted_ip_id)
        response_raw = api_client.get(endpoint_url, {}, custom_headers)

        return BunqResponsePermittedIp.cast_from_bunq_response(
            cls._from_json(response_raw, cls._OBJECT_TYPE_GET)
        )
81291
def access_key(self):
        
        credential = self.query_parameters.get(_x_amz_credential)
        if credential is not None:
            credential = url_unquote(credential[0])
        else:
            credential = self.authorization_header_parameters.get(_credential)

            if credential is None:
                raise AttributeError("Credential was not passed in the request")
        try:
            key, scope = credential.split("/", 1)
        except ValueError:
            raise AttributeError("Invalid request credential: %r" % credential)

        if scope != self.credential_scope:
            raise AttributeError("Incorrect credential scope: %r (wanted %r)" %
                                 (scope, self.credential_scope))

        return key
945796
def get_credentials_arn(self):
        
        role = self.iam.Role(self.role_name)
        self.credentials_arn = role.arn
        return role, self.credentials_arn
580180
def account(self):
        
        data = self.query(Account.key)
        return Account(self, data)
1226580
def GetAccounts(self):
    
    selector = {
        'fields': ['CustomerId', 'CanManageClients']
    }

    accounts = self.client.GetService('ManagedCustomerService').get(selector)

    return accounts['entries']
45595
def get_uri(self):
        
        url = Url()
        url.protocol = self.get_protocol()
        url.hostname = self.get_address()
        url.port = self.get_tcp_port()
        url.vars = dict((k, to_list(v))
                        for (k, v) in list(self.get_all().items())
                        if isinstance(v, str) or isinstance(v, list))

        if self.account:
            url.username = self.account.get_name()
            url.password1 = self.account.get_password()
            url.password2 = self.account.authorization_password

        return str(url)
573255
def available_metadata(self):
        
        url = self.base_url + 'metadata/types'
        headers = {'Authorization': 'Bearer {}'.format(self.auth())}
        r = requests.get(url, headers=headers)
        return pd.read_json(r.content, orient='records')['name']