From Code

You can override/set credentials from code by passing a dict to the client.

If you pass a value in credentials, other credentials from env variables or from a config file will be ignored.

Note

Required fields are:

  • lwa_app_id

  • lwa_client_secret

If you don’t set the refresh_token, you have to pass it to the client.

Orders(refresh_token='...')

Warning

If you have assigned the execute-api (STS) permissions to your AWS user, omit role_arn.

If you have assigned the permissions to a role, the role_arn parameter is required.

credentials=dict(
        refresh_token='<refresh_token>',
        lwa_app_id='<lwa_app_id>',
        lwa_client_secret='<lwa_client_secret>'
    )

Usage

Orders(credentials=credentials).get_orders(CreatedAfter=(datetime.utcnow() - timedelta(days=7)).isoformat())