patch method

Future<TransferConfig> patch(
  1. TransferConfig request,
  2. String name, {
  3. String? authorizationCode,
  4. String? serviceAccountName,
  5. String? updateMask,
  6. String? versionInfo,
  7. String? $fields,
})

Updates a data transfer configuration.

All fields must be set, even if they are not updated.

request - The metadata request object.

Request parameters:

name - Identifier. The resource name of the transfer config. Transfer config names have the form either projects/{project_id}/locations/{region}/transferConfigs/{config_id} or projects/{project_id}/transferConfigs/{config_id}, where config_id is usually a UUID, even though it is not guaranteed or required. The name is ignored when creating a transfer config. Value must have pattern ^projects/\[^/\]+/locations/\[^/\]+/transferConfigs/\[^/\]+$.

authorizationCode - Optional OAuth2 authorization code to use with this transfer configuration. This is required only if transferConfig.dataSourceId is 'youtube_channel' and new credentials are needed, as indicated by CheckValidCreds. In order to obtain authorization_code, make a request to the following URL: https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=authorization_code&client_id=client_id&scope=data_source_scopes

  • The client_id is the OAuth client_id of the a data source as returned by ListDataSources method. * data_source_scopes are the scopes returned by ListDataSources method. Note that this should not be set when service_account_name is used to update the transfer config.

serviceAccountName - Optional service account email. If this field is set, the transfer config will be created with this service account's credentials. It requires that the requesting user calling this API has permissions to act as this service account. Note that not all data sources support service account credentials when creating a transfer config. For the latest list of data sources, read about using service accounts.

updateMask - Required. Required list of fields to be updated in this request.

versionInfo - Optional version info. This is required only if transferConfig.dataSourceId is not 'youtube_channel' and new credentials are needed, as indicated by CheckValidCreds. In order to obtain version info, make a request to the following URL: https://bigquery.cloud.google.com/datatransfer/oauthz/auth?redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=version_info&client_id=client_id&scope=data_source_scopes

  • The client_id is the OAuth client_id of the a data source as returned by ListDataSources method. * data_source_scopes are the scopes returned by ListDataSources method. Note that this should not be set when service_account_name is used to update the transfer config.

$fields - Selector specifying which fields to include in a partial response.

Completes with a TransferConfig.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<TransferConfig> patch(
  TransferConfig request,
  core.String name, {
  core.String? authorizationCode,
  core.String? serviceAccountName,
  core.String? updateMask,
  core.String? versionInfo,
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    if (authorizationCode != null) 'authorizationCode': [authorizationCode],
    if (serviceAccountName != null)
      'serviceAccountName': [serviceAccountName],
    if (updateMask != null) 'updateMask': [updateMask],
    if (versionInfo != null) 'versionInfo': [versionInfo],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'v1/' + core.Uri.encodeFull('$name');

  final response_ = await _requester.request(
    url_,
    'PATCH',
    body: body_,
    queryParams: queryParams_,
  );
  return TransferConfig.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}