File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
internal/sidekick/internal/dart/templates/lib Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -21,9 +21,27 @@ final class {{Codec.Name}} {
2121 static const _host = ' {{DefaultHost}}' ;
2222 final ServiceClient _client;
2323
24+ /// Creates a `{{Codec.Name} }` using [client] for transport.
25+ ///
26+ /// The provided [http.Client] must be configured to provide whatever
27+ /// authentication is required by `{ {Codec.Name} }`. You can do that
28+ /// using
29+ /// [`package:googleapis_auth`](https://pub.dev/packages/googleapis_auth).
2430 { {Codec.Name} }({ required http.Client client} )
2531 : _client = ServiceClient(client: client);
2632
33+ /// Creates a `{ {Codec.Name} }` that does authentication through an API key.
34+ ///
35+ /// If called without arguments, the API key is taken from these environment
36+ /// variables:
37+ { {#Model.Codec.ApiKeyEnvironmentVariables} }
38+ /// * `{ {{.} }}`
39+ { {/Model.Codec.ApiKeyEnvironmentVariables} }
40+ ///
41+ /// Throws [ArgumentError] if called without arguments and none of the above
42+ /// environment variables are set.
43+ ///
44+ /// See [API Keys Overview](https://cloud.google.com/api-keys/docs/overview).
2745 factory { {Codec.Name} }.fromApiKey([String? apiKey]) {
2846 apiKey ??= _apiKeys.map(environmentVariable).nonNulls.firstOrNull;
2947 if (apiKey == null) {
You can’t perform that action at this time.
0 commit comments