Skip to content

Commit eafffd2

Browse files
committed
update readme
1 parent 9ac49de commit eafffd2

13 files changed

+367
-51
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ configuration = bandwidth.Configuration(
7373
password = os.environ["PASSWORD"]
7474
)
7575

76-
configuration.access_token = os.environ["ACCESS_TOKEN"]
76+
# Configure your client ID and secret for OAuth
77+
configuration = bandwidth.Configuration(
78+
client_id = os.environ["CLIENT_ID"],
79+
client_secret = os.environ["CLIENT_SECRET"]
80+
)
7781

7882

7983
# Enter a context with an instance of the API client
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# Defining the host is optional and defaults to {{{basePath}}}
2+
# See configuration.py for a list of all supported configuration parameters.
3+
configuration = {{{packageName}}}.Configuration(
4+
host = "{{{basePath}}}"
5+
)
6+
7+
{{#hasAuthMethods}}
8+
# The client must configure the authentication and authorization parameters
9+
# in accordance with the API server security policy.
10+
# Examples for each auth method are provided below, use the example that
11+
# satisfies your auth use case.
12+
{{#authMethods}}
13+
{{#isBasic}}
14+
{{#isBasicBasic}}
15+
16+
# Configure HTTP basic authorization: {{{name}}}
17+
configuration = {{{packageName}}}.Configuration(
18+
username = os.environ["USERNAME"],
19+
password = os.environ["PASSWORD"]
20+
)
21+
{{/isBasicBasic}}
22+
{{#isBasicBearer}}
23+
24+
# Configure Bearer authorization{{#bearerFormat}} ({{{.}}}){{/bearerFormat}}: {{{name}}}
25+
configuration = {{{packageName}}}.Configuration(
26+
access_token = os.environ["BEARER_TOKEN"]
27+
)
28+
{{/isBasicBearer}}
29+
{{#isHttpSignature}}
30+
31+
# Configure HTTP message signature: {{{name}}}
32+
# The HTTP Signature Header mechanism that can be used by a client to
33+
# authenticate the sender of a message and ensure that particular headers
34+
# have not been modified in transit.
35+
#
36+
# You can specify the signing key-id, private key path, signing scheme,
37+
# signing algorithm, list of signed headers and signature max validity.
38+
# The 'key_id' parameter is an opaque string that the API server can use
39+
# to lookup the client and validate the signature.
40+
# The 'private_key_path' parameter should be the path to a file that
41+
# contains a DER or base-64 encoded private key.
42+
# The 'private_key_passphrase' parameter is optional. Set the passphrase
43+
# if the private key is encrypted.
44+
# The 'signed_headers' parameter is used to specify the list of
45+
# HTTP headers included when generating the signature for the message.
46+
# You can specify HTTP headers that you want to protect with a cryptographic
47+
# signature. Note that proxies may add, modify or remove HTTP headers
48+
# for legitimate reasons, so you should only add headers that you know
49+
# will not be modified. For example, if you want to protect the HTTP request
50+
# body, you can specify the Digest header. In that case, the client calculates
51+
# the digest of the HTTP request body and includes the digest in the message
52+
# signature.
53+
# The 'signature_max_validity' parameter is optional. It is configured as a
54+
# duration to express when the signature ceases to be valid. The client calculates
55+
# the expiration date every time it generates the cryptographic signature
56+
# of an HTTP request. The API server may have its own security policy
57+
# that controls the maximum validity of the signature. The client max validity
58+
# must be lower than the server max validity.
59+
# The time on the client and server must be synchronized, otherwise the
60+
# server may reject the client signature.
61+
#
62+
# The client must use a combination of private key, signing scheme,
63+
# signing algorithm and hash algorithm that matches the security policy of
64+
# the API server.
65+
#
66+
# See {{{packageName}}}.signing for a list of all supported parameters.
67+
from {{{packageName}}} import signing
68+
import datetime
69+
70+
configuration = {{{packageName}}}.Configuration(
71+
host = "{{{basePath}}}",
72+
signing_info = {{{packageName}}}.HttpSigningConfiguration(
73+
key_id = 'my-key-id',
74+
private_key_path = 'private_key.pem',
75+
private_key_passphrase = 'YOUR_PASSPHRASE',
76+
signing_scheme = {{{packageName}}}.signing.SCHEME_HS2019,
77+
signing_algorithm = {{{packageName}}}.signing.ALGORITHM_ECDSA_MODE_FIPS_186_3,
78+
hash_algorithm = {{{packageName}}}.signing.SCHEME_RSA_SHA256,
79+
signed_headers = [
80+
{{{packageName}}}.signing.HEADER_REQUEST_TARGET,
81+
{{{packageName}}}.signing.HEADER_CREATED,
82+
{{{packageName}}}.signing.HEADER_EXPIRES,
83+
{{{packageName}}}.signing.HEADER_HOST,
84+
{{{packageName}}}.signing.HEADER_DATE,
85+
{{{packageName}}}.signing.HEADER_DIGEST,
86+
'Content-Type',
87+
'Content-Length',
88+
'User-Agent'
89+
],
90+
signature_max_validity = datetime.timedelta(minutes=5)
91+
)
92+
)
93+
{{/isHttpSignature}}
94+
{{/isBasic}}
95+
{{#isApiKey}}
96+
97+
# Configure API key authorization: {{{name}}}
98+
configuration.api_key['{{{name}}}'] = os.environ["API_KEY"]
99+
100+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
101+
# configuration.api_key_prefix['{{name}}'] = 'Bearer'
102+
{{/isApiKey}}
103+
{{#isOAuth}}
104+
105+
# Configure your client ID and secret for OAuth
106+
configuration = {{{packageName}}}.Configuration(
107+
client_id = os.environ["CLIENT_ID"],
108+
client_secret = os.environ["CLIENT_SECRET"]
109+
)
110+
{{/isOAuth}}
111+
{{/authMethods}}
112+
{{/hasAuthMethods}}

docs/CallsApi.md

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ configuration = bandwidth.Configuration(
5151
password = os.environ["PASSWORD"]
5252
)
5353

54-
configuration.access_token = os.environ["ACCESS_TOKEN"]
54+
# Configure your client ID and secret for OAuth
55+
configuration = bandwidth.Configuration(
56+
client_id = os.environ["CLIENT_ID"],
57+
client_secret = os.environ["CLIENT_SECRET"]
58+
)
5559

5660
# Enter a context with an instance of the API client
5761
with bandwidth.ApiClient(configuration) as api_client:
@@ -145,7 +149,11 @@ configuration = bandwidth.Configuration(
145149
password = os.environ["PASSWORD"]
146150
)
147151

148-
configuration.access_token = os.environ["ACCESS_TOKEN"]
152+
# Configure your client ID and secret for OAuth
153+
configuration = bandwidth.Configuration(
154+
client_id = os.environ["CLIENT_ID"],
155+
client_secret = os.environ["CLIENT_SECRET"]
156+
)
149157

150158
# Enter a context with an instance of the API client
151159
with bandwidth.ApiClient(configuration) as api_client:
@@ -240,7 +248,11 @@ configuration = bandwidth.Configuration(
240248
password = os.environ["PASSWORD"]
241249
)
242250

243-
configuration.access_token = os.environ["ACCESS_TOKEN"]
251+
# Configure your client ID and secret for OAuth
252+
configuration = bandwidth.Configuration(
253+
client_id = os.environ["CLIENT_ID"],
254+
client_secret = os.environ["CLIENT_SECRET"]
255+
)
244256

245257
# Enter a context with an instance of the API client
246258
with bandwidth.ApiClient(configuration) as api_client:
@@ -344,7 +356,11 @@ configuration = bandwidth.Configuration(
344356
password = os.environ["PASSWORD"]
345357
)
346358

347-
configuration.access_token = os.environ["ACCESS_TOKEN"]
359+
# Configure your client ID and secret for OAuth
360+
configuration = bandwidth.Configuration(
361+
client_id = os.environ["CLIENT_ID"],
362+
client_secret = os.environ["CLIENT_SECRET"]
363+
)
348364

349365
# Enter a context with an instance of the API client
350366
with bandwidth.ApiClient(configuration) as api_client:
@@ -436,7 +452,11 @@ configuration = bandwidth.Configuration(
436452
password = os.environ["PASSWORD"]
437453
)
438454

439-
configuration.access_token = os.environ["ACCESS_TOKEN"]
455+
# Configure your client ID and secret for OAuth
456+
configuration = bandwidth.Configuration(
457+
client_id = os.environ["CLIENT_ID"],
458+
client_secret = os.environ["CLIENT_SECRET"]
459+
)
440460

441461
# Enter a context with an instance of the API client
442462
with bandwidth.ApiClient(configuration) as api_client:

docs/ConferencesApi.md

Lines changed: 45 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ configuration = bandwidth.Configuration(
4949
password = os.environ["PASSWORD"]
5050
)
5151

52-
configuration.access_token = os.environ["ACCESS_TOKEN"]
52+
# Configure your client ID and secret for OAuth
53+
configuration = bandwidth.Configuration(
54+
client_id = os.environ["CLIENT_ID"],
55+
client_secret = os.environ["CLIENT_SECRET"]
56+
)
5357

5458
# Enter a context with an instance of the API client
5559
with bandwidth.ApiClient(configuration) as api_client:
@@ -143,7 +147,11 @@ configuration = bandwidth.Configuration(
143147
password = os.environ["PASSWORD"]
144148
)
145149

146-
configuration.access_token = os.environ["ACCESS_TOKEN"]
150+
# Configure your client ID and secret for OAuth
151+
configuration = bandwidth.Configuration(
152+
client_id = os.environ["CLIENT_ID"],
153+
client_secret = os.environ["CLIENT_SECRET"]
154+
)
147155

148156
# Enter a context with an instance of the API client
149157
with bandwidth.ApiClient(configuration) as api_client:
@@ -235,7 +243,11 @@ configuration = bandwidth.Configuration(
235243
password = os.environ["PASSWORD"]
236244
)
237245

238-
configuration.access_token = os.environ["ACCESS_TOKEN"]
246+
# Configure your client ID and secret for OAuth
247+
configuration = bandwidth.Configuration(
248+
client_id = os.environ["CLIENT_ID"],
249+
client_secret = os.environ["CLIENT_SECRET"]
250+
)
239251

240252
# Enter a context with an instance of the API client
241253
with bandwidth.ApiClient(configuration) as api_client:
@@ -329,7 +341,11 @@ configuration = bandwidth.Configuration(
329341
password = os.environ["PASSWORD"]
330342
)
331343

332-
configuration.access_token = os.environ["ACCESS_TOKEN"]
344+
# Configure your client ID and secret for OAuth
345+
configuration = bandwidth.Configuration(
346+
client_id = os.environ["CLIENT_ID"],
347+
client_secret = os.environ["CLIENT_SECRET"]
348+
)
333349

334350
# Enter a context with an instance of the API client
335351
with bandwidth.ApiClient(configuration) as api_client:
@@ -423,7 +439,11 @@ configuration = bandwidth.Configuration(
423439
password = os.environ["PASSWORD"]
424440
)
425441

426-
configuration.access_token = os.environ["ACCESS_TOKEN"]
442+
# Configure your client ID and secret for OAuth
443+
configuration = bandwidth.Configuration(
444+
client_id = os.environ["CLIENT_ID"],
445+
client_secret = os.environ["CLIENT_SECRET"]
446+
)
427447

428448
# Enter a context with an instance of the API client
429449
with bandwidth.ApiClient(configuration) as api_client:
@@ -517,7 +537,11 @@ configuration = bandwidth.Configuration(
517537
password = os.environ["PASSWORD"]
518538
)
519539

520-
configuration.access_token = os.environ["ACCESS_TOKEN"]
540+
# Configure your client ID and secret for OAuth
541+
configuration = bandwidth.Configuration(
542+
client_id = os.environ["CLIENT_ID"],
543+
client_secret = os.environ["CLIENT_SECRET"]
544+
)
521545

522546
# Enter a context with an instance of the API client
523547
with bandwidth.ApiClient(configuration) as api_client:
@@ -617,7 +641,11 @@ configuration = bandwidth.Configuration(
617641
password = os.environ["PASSWORD"]
618642
)
619643

620-
configuration.access_token = os.environ["ACCESS_TOKEN"]
644+
# Configure your client ID and secret for OAuth
645+
configuration = bandwidth.Configuration(
646+
client_id = os.environ["CLIENT_ID"],
647+
client_secret = os.environ["CLIENT_SECRET"]
648+
)
621649

622650
# Enter a context with an instance of the API client
623651
with bandwidth.ApiClient(configuration) as api_client:
@@ -708,7 +736,11 @@ configuration = bandwidth.Configuration(
708736
password = os.environ["PASSWORD"]
709737
)
710738

711-
configuration.access_token = os.environ["ACCESS_TOKEN"]
739+
# Configure your client ID and secret for OAuth
740+
configuration = bandwidth.Configuration(
741+
client_id = os.environ["CLIENT_ID"],
742+
client_secret = os.environ["CLIENT_SECRET"]
743+
)
712744

713745
# Enter a context with an instance of the API client
714746
with bandwidth.ApiClient(configuration) as api_client:
@@ -803,7 +835,11 @@ configuration = bandwidth.Configuration(
803835
password = os.environ["PASSWORD"]
804836
)
805837

806-
configuration.access_token = os.environ["ACCESS_TOKEN"]
838+
# Configure your client ID and secret for OAuth
839+
configuration = bandwidth.Configuration(
840+
client_id = os.environ["CLIENT_ID"],
841+
client_secret = os.environ["CLIENT_SECRET"]
842+
)
807843

808844
# Enter a context with an instance of the API client
809845
with bandwidth.ApiClient(configuration) as api_client:

docs/MFAApi.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ configuration = bandwidth.Configuration(
4545
password = os.environ["PASSWORD"]
4646
)
4747

48-
configuration.access_token = os.environ["ACCESS_TOKEN"]
48+
# Configure your client ID and secret for OAuth
49+
configuration = bandwidth.Configuration(
50+
client_id = os.environ["CLIENT_ID"],
51+
client_secret = os.environ["CLIENT_SECRET"]
52+
)
4953

5054
# Enter a context with an instance of the API client
5155
with bandwidth.ApiClient(configuration) as api_client:
@@ -134,7 +138,11 @@ configuration = bandwidth.Configuration(
134138
password = os.environ["PASSWORD"]
135139
)
136140

137-
configuration.access_token = os.environ["ACCESS_TOKEN"]
141+
# Configure your client ID and secret for OAuth
142+
configuration = bandwidth.Configuration(
143+
client_id = os.environ["CLIENT_ID"],
144+
client_secret = os.environ["CLIENT_SECRET"]
145+
)
138146

139147
# Enter a context with an instance of the API client
140148
with bandwidth.ApiClient(configuration) as api_client:
@@ -223,7 +231,11 @@ configuration = bandwidth.Configuration(
223231
password = os.environ["PASSWORD"]
224232
)
225233

226-
configuration.access_token = os.environ["ACCESS_TOKEN"]
234+
# Configure your client ID and secret for OAuth
235+
configuration = bandwidth.Configuration(
236+
client_id = os.environ["CLIENT_ID"],
237+
client_secret = os.environ["CLIENT_SECRET"]
238+
)
227239

228240
# Enter a context with an instance of the API client
229241
with bandwidth.ApiClient(configuration) as api_client:

docs/MediaApi.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,11 @@ configuration = bandwidth.Configuration(
4848
password = os.environ["PASSWORD"]
4949
)
5050

51-
configuration.access_token = os.environ["ACCESS_TOKEN"]
51+
# Configure your client ID and secret for OAuth
52+
configuration = bandwidth.Configuration(
53+
client_id = os.environ["CLIENT_ID"],
54+
client_secret = os.environ["CLIENT_SECRET"]
55+
)
5256

5357
# Enter a context with an instance of the API client
5458
with bandwidth.ApiClient(configuration) as api_client:
@@ -137,7 +141,11 @@ configuration = bandwidth.Configuration(
137141
password = os.environ["PASSWORD"]
138142
)
139143

140-
configuration.access_token = os.environ["ACCESS_TOKEN"]
144+
# Configure your client ID and secret for OAuth
145+
configuration = bandwidth.Configuration(
146+
client_id = os.environ["CLIENT_ID"],
147+
client_secret = os.environ["CLIENT_SECRET"]
148+
)
141149

142150
# Enter a context with an instance of the API client
143151
with bandwidth.ApiClient(configuration) as api_client:
@@ -229,7 +237,11 @@ configuration = bandwidth.Configuration(
229237
password = os.environ["PASSWORD"]
230238
)
231239

232-
configuration.access_token = os.environ["ACCESS_TOKEN"]
240+
# Configure your client ID and secret for OAuth
241+
configuration = bandwidth.Configuration(
242+
client_id = os.environ["CLIENT_ID"],
243+
client_secret = os.environ["CLIENT_SECRET"]
244+
)
233245

234246
# Enter a context with an instance of the API client
235247
with bandwidth.ApiClient(configuration) as api_client:
@@ -324,7 +336,11 @@ configuration = bandwidth.Configuration(
324336
password = os.environ["PASSWORD"]
325337
)
326338

327-
configuration.access_token = os.environ["ACCESS_TOKEN"]
339+
# Configure your client ID and secret for OAuth
340+
configuration = bandwidth.Configuration(
341+
client_id = os.environ["CLIENT_ID"],
342+
client_secret = os.environ["CLIENT_SECRET"]
343+
)
328344

329345
# Enter a context with an instance of the API client
330346
with bandwidth.ApiClient(configuration) as api_client:

0 commit comments

Comments
 (0)