Resource Settings v1 API - Class ResourceSettingsServiceClient (2.3.0)

public abstract class ResourceSettingsServiceClient

Reference documentation and code samples for the Resource Settings v1 API class ResourceSettingsServiceClient.

ResourceSettingsService client wrapper, for convenient use.

Inheritance

object > ResourceSettingsServiceClient

Namespace

Google.Cloud.ResourceSettings.V1

Assembly

Google.Cloud.ResourceSettings.V1.dll

Remarks

An interface to interact with resource settings and setting values throughout the resource hierarchy.

Services may surface a number of settings for users to control how their resources behave. Values of settings applied on a given Cloud resource are evaluated hierarchically and inherited by all descendants of that resource.

For all requests, returns a google.rpc.Status with google.rpc.Code.PERMISSION_DENIED if the IAM check fails or the parent resource is not in a Cloud Organization. For all requests, returns a google.rpc.Status with google.rpc.Code.INVALID_ARGUMENT if the request is malformed.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the ResourceSettingsService service, which is a host of "resourcesettings.googleapis.com" and a port of 443.

Property Value
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default ResourceSettingsService scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

The default ResourceSettingsService scopes are:

GrpcClient

public virtual ResourceSettingsService.ResourceSettingsServiceClient GrpcClient { get; }

The underlying gRPC ResourceSettingsService client

Property Value
Type Description
ResourceSettingsServiceResourceSettingsServiceClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
Type Description
ServiceMetadata

Methods

Create()

public static ResourceSettingsServiceClient Create()

Synchronously creates a ResourceSettingsServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ResourceSettingsServiceClientBuilder.

Returns
Type Description
ResourceSettingsServiceClient

The created ResourceSettingsServiceClient.

CreateAsync(CancellationToken)

public static Task<ResourceSettingsServiceClient> CreateAsync(CancellationToken cancellationToken = default)

Asynchronously creates a ResourceSettingsServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use ResourceSettingsServiceClientBuilder.

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskResourceSettingsServiceClient

The task representing the created ResourceSettingsServiceClient.

GetSetting(GetSettingRequest, CallSettings)

public virtual Setting GetSetting(GetSettingRequest request, CallSettings callSettings = null)

Gets a setting.

Returns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the setting does not exist.

Parameters
Name Description
request GetSettingRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Setting

The RPC response.

Example
// Create client
ResourceSettingsServiceClient resourceSettingsServiceClient = ResourceSettingsServiceClient.Create();
// Initialize request argument(s)
GetSettingRequest request = new GetSettingRequest
{
    SettingName = SettingName.FromProjectNumberSettingName("[PROJECT_NUMBER]", "[SETTING_NAME]"),
    View = SettingView.Unspecified,
};
// Make the request
Setting response = resourceSettingsServiceClient.GetSetting(request);

GetSetting(SettingName, CallSettings)

public virtual Setting GetSetting(SettingName name, CallSettings callSettings = null)

Gets a setting.

Returns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the setting does not exist.

Parameters
Name Description
name SettingName

Required. The name of the setting to get. See [Setting][google.cloud.resourcesettings.v1.Setting] for naming requirements.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Setting

The RPC response.

Example
// Create client
ResourceSettingsServiceClient resourceSettingsServiceClient = ResourceSettingsServiceClient.Create();
// Initialize request argument(s)
SettingName name = SettingName.FromProjectNumberSettingName("[PROJECT_NUMBER]", "[SETTING_NAME]");
// Make the request
Setting response = resourceSettingsServiceClient.GetSetting(name);

GetSetting(string, CallSettings)

public virtual Setting GetSetting(string name, CallSettings callSettings = null)

Gets a setting.

Returns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the setting does not exist.

Parameters
Name Description
name string

Required. The name of the setting to get. See [Setting][google.cloud.resourcesettings.v1.Setting] for naming requirements.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Setting

The RPC response.

Example
// Create client
ResourceSettingsServiceClient resourceSettingsServiceClient = ResourceSettingsServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT_NUMBER]/settings/[SETTING_NAME]";
// Make the request
Setting response = resourceSettingsServiceClient.GetSetting(name);

GetSettingAsync(GetSettingRequest, CallSettings)

public virtual Task<Setting> GetSettingAsync(GetSettingRequest request, CallSettings callSettings = null)

Gets a setting.

Returns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the setting does not exist.

Parameters
Name Description
request GetSettingRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSetting

A Task containing the RPC response.

Example
// Create client
ResourceSettingsServiceClient resourceSettingsServiceClient = await ResourceSettingsServiceClient.CreateAsync();
// Initialize request argument(s)
GetSettingRequest request = new GetSettingRequest
{
    SettingName = SettingName.FromProjectNumberSettingName("[PROJECT_NUMBER]", "[SETTING_NAME]"),
    View = SettingView.Unspecified,
};
// Make the request
Setting response = await resourceSettingsServiceClient.GetSettingAsync(request);

GetSettingAsync(GetSettingRequest, CancellationToken)

public virtual Task<Setting> GetSettingAsync(GetSettingRequest request, CancellationToken cancellationToken)

Gets a setting.

Returns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the setting does not exist.

Parameters
Name Description
request GetSettingRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskSetting

A Task containing the RPC response.

Example
// Create client
ResourceSettingsServiceClient resourceSettingsServiceClient = await ResourceSettingsServiceClient.CreateAsync();
// Initialize request argument(s)
GetSettingRequest request = new GetSettingRequest
{
    SettingName = SettingName.FromProjectNumberSettingName("[PROJECT_NUMBER]", "[SETTING_NAME]"),
    View = SettingView.Unspecified,
};
// Make the request
Setting response = await resourceSettingsServiceClient.GetSettingAsync(request);

GetSettingAsync(SettingName, CallSettings)

public virtual Task<Setting> GetSettingAsync(SettingName name, CallSettings callSettings = null)

Gets a setting.

Returns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the setting does not exist.

Parameters
Name Description
name SettingName

Required. The name of the setting to get. See [Setting][google.cloud.resourcesettings.v1.Setting] for naming requirements.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSetting

A Task containing the RPC response.

Example
// Create client
ResourceSettingsServiceClient resourceSettingsServiceClient = await ResourceSettingsServiceClient.CreateAsync();
// Initialize request argument(s)
SettingName name = SettingName.FromProjectNumberSettingName("[PROJECT_NUMBER]", "[SETTING_NAME]");
// Make the request
Setting response = await resourceSettingsServiceClient.GetSettingAsync(name);

GetSettingAsync(SettingName, CancellationToken)

public virtual Task<Setting> GetSettingAsync(SettingName name, CancellationToken cancellationToken)

Gets a setting.

Returns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the setting does not exist.

Parameters
Name Description
name SettingName

Required. The name of the setting to get. See [Setting][google.cloud.resourcesettings.v1.Setting] for naming requirements.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskSetting

A Task containing the RPC response.

Example
// Create client
ResourceSettingsServiceClient resourceSettingsServiceClient = await ResourceSettingsServiceClient.CreateAsync();
// Initialize request argument(s)
SettingName name = SettingName.FromProjectNumberSettingName("[PROJECT_NUMBER]", "[SETTING_NAME]");
// Make the request
Setting response = await resourceSettingsServiceClient.GetSettingAsync(name);

GetSettingAsync(string, CallSettings)

public virtual Task<Setting> GetSettingAsync(string name, CallSettings callSettings = null)

Gets a setting.

Returns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the setting does not exist.

Parameters
Name Description
name string

Required. The name of the setting to get. See [Setting][google.cloud.resourcesettings.v1.Setting] for naming requirements.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSetting

A Task containing the RPC response.

Example
// Create client
ResourceSettingsServiceClient resourceSettingsServiceClient = await ResourceSettingsServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT_NUMBER]/settings/[SETTING_NAME]";
// Make the request
Setting response = await resourceSettingsServiceClient.GetSettingAsync(name);

GetSettingAsync(string, CancellationToken)

public virtual Task<Setting> GetSettingAsync(string name, CancellationToken cancellationToken)

Gets a setting.

Returns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the setting does not exist.

Parameters
Name Description
name string

Required. The name of the setting to get. See [Setting][google.cloud.resourcesettings.v1.Setting] for naming requirements.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskSetting

A Task containing the RPC response.

Example
// Create client
ResourceSettingsServiceClient resourceSettingsServiceClient = await ResourceSettingsServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT_NUMBER]/settings/[SETTING_NAME]";
// Make the request
Setting response = await resourceSettingsServiceClient.GetSettingAsync(name);

ListSettings(IResourceName, string, int?, CallSettings)

public virtual PagedEnumerable<ListSettingsResponse, Setting> ListSettings(IResourceName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all the settings that are available on the Cloud resource parent.

Parameters
Name Description
parent IResourceName

Required. The Cloud resource that parents the setting. Must be in one of the following forms:

  • projects/{project_number}
  • projects/{project_id}
  • folders/{folder_id}
  • organizations/{organization_id}
pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListSettingsResponseSetting

A pageable sequence of Setting resources.

Example
// Create client
ResourceSettingsServiceClient resourceSettingsServiceClient = ResourceSettingsServiceClient.Create();
// Initialize request argument(s)
IResourceName parent = new UnparsedResourceName("a/wildcard/resource");
// Make the request
PagedEnumerable<ListSettingsResponse, Setting> response = resourceSettingsServiceClient.ListSettings(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (Setting item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListSettingsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Setting item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Setting> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Setting item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListSettings(ListSettingsRequest, CallSettings)

public virtual PagedEnumerable<ListSettingsResponse, Setting> ListSettings(ListSettingsRequest request, CallSettings callSettings = null)

Lists all the settings that are available on the Cloud resource parent.

Parameters
Name Description
request ListSettingsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListSettingsResponseSetting

A pageable sequence of Setting resources.

Example
// Create client
ResourceSettingsServiceClient resourceSettingsServiceClient = ResourceSettingsServiceClient.Create();
// Initialize request argument(s)
ListSettingsRequest request = new ListSettingsRequest
{
    ParentAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    View = SettingView.Unspecified,
};
// Make the request
PagedEnumerable<ListSettingsResponse, Setting> response = resourceSettingsServiceClient.ListSettings(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (Setting item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListSettingsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Setting item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Setting> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Setting item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListSettings(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListSettingsResponse, Setting> ListSettings(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all the settings that are available on the Cloud resource parent.

Parameters
Name Description
parent string

Required. The Cloud resource that parents the setting. Must be in one of the following forms:

  • projects/{project_number}
  • projects/{project_id}
  • folders/{folder_id}
  • organizations/{organization_id}
pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListSettingsResponseSetting

A pageable sequence of Setting resources.

Example
// Create client
ResourceSettingsServiceClient resourceSettingsServiceClient = ResourceSettingsServiceClient.Create();
// Initialize request argument(s)
string parent = "a/wildcard/resource";
// Make the request
PagedEnumerable<ListSettingsResponse, Setting> response = resourceSettingsServiceClient.ListSettings(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (Setting item in response)
{
    // Do something with each item
    Console.WriteLine(item);
}

// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListSettingsResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Setting item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
}

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Setting> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Setting item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListSettingsAsync(IResourceName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListSettingsResponse, Setting> ListSettingsAsync(IResourceName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all the settings that are available on the Cloud resource parent.

Parameters
Name Description
parent IResourceName

Required. The Cloud resource that parents the setting. Must be in one of the following forms:

  • projects/{project_number}
  • projects/{project_id}
  • folders/{folder_id}
  • organizations/{organization_id}
pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListSettingsResponseSetting

A pageable asynchronous sequence of Setting resources.

Example
// Create client
ResourceSettingsServiceClient resourceSettingsServiceClient = await ResourceSettingsServiceClient.CreateAsync();
// Initialize request argument(s)
IResourceName parent = new UnparsedResourceName("a/wildcard/resource");
// Make the request
PagedAsyncEnumerable<ListSettingsResponse, Setting> response = resourceSettingsServiceClient.ListSettingsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Setting item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListSettingsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Setting item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Setting> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Setting item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListSettingsAsync(ListSettingsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListSettingsResponse, Setting> ListSettingsAsync(ListSettingsRequest request, CallSettings callSettings = null)

Lists all the settings that are available on the Cloud resource parent.

Parameters
Name Description
request ListSettingsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListSettingsResponseSetting

A pageable asynchronous sequence of Setting resources.

Example
// Create client
ResourceSettingsServiceClient resourceSettingsServiceClient = await ResourceSettingsServiceClient.CreateAsync();
// Initialize request argument(s)
ListSettingsRequest request = new ListSettingsRequest
{
    ParentAsResourceName = new UnparsedResourceName("a/wildcard/resource"),
    View = SettingView.Unspecified,
};
// Make the request
PagedAsyncEnumerable<ListSettingsResponse, Setting> response = resourceSettingsServiceClient.ListSettingsAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Setting item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListSettingsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Setting item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Setting> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Setting item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ListSettingsAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListSettingsResponse, Setting> ListSettingsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all the settings that are available on the Cloud resource parent.

Parameters
Name Description
parent string

Required. The Cloud resource that parents the setting. Must be in one of the following forms:

  • projects/{project_number}
  • projects/{project_id}
  • folders/{folder_id}
  • organizations/{organization_id}
pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListSettingsResponseSetting

A pageable asynchronous sequence of Setting resources.

Example
// Create client
ResourceSettingsServiceClient resourceSettingsServiceClient = await ResourceSettingsServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "a/wildcard/resource";
// Make the request
PagedAsyncEnumerable<ListSettingsResponse, Setting> response = resourceSettingsServiceClient.ListSettingsAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Setting item) =>
{
    // Do something with each item
    Console.WriteLine(item);
});

// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListSettingsResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (Setting item in page)
    {
        // Do something with each item
        Console.WriteLine(item);
    }
});

// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Setting> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Setting item in singlePage)
{
    // Do something with each item
    Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
Type Description
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.

UpdateSetting(UpdateSettingRequest, CallSettings)

public virtual Setting UpdateSetting(UpdateSettingRequest request, CallSettings callSettings = null)

Updates a setting.

Returns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the setting does not exist. Returns a google.rpc.Status with google.rpc.Code.FAILED_PRECONDITION if the setting is flagged as read only. Returns a google.rpc.Status with google.rpc.Code.ABORTED if the etag supplied in the request does not match the persisted etag of the setting value.

On success, the response will contain only name, local_value and etag. The metadata and effective_value cannot be updated through this API.

Note: the supplied setting will perform a full overwrite of the local_value field.

Parameters
Name Description
request UpdateSettingRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Setting

The RPC response.

Example
// Create client
ResourceSettingsServiceClient resourceSettingsServiceClient = ResourceSettingsServiceClient.Create();
// Initialize request argument(s)
UpdateSettingRequest request = new UpdateSettingRequest
{
    Setting = new Setting(),
};
// Make the request
Setting response = resourceSettingsServiceClient.UpdateSetting(request);

UpdateSettingAsync(UpdateSettingRequest, CallSettings)

public virtual Task<Setting> UpdateSettingAsync(UpdateSettingRequest request, CallSettings callSettings = null)

Updates a setting.

Returns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the setting does not exist. Returns a google.rpc.Status with google.rpc.Code.FAILED_PRECONDITION if the setting is flagged as read only. Returns a google.rpc.Status with google.rpc.Code.ABORTED if the etag supplied in the request does not match the persisted etag of the setting value.

On success, the response will contain only name, local_value and etag. The metadata and effective_value cannot be updated through this API.

Note: the supplied setting will perform a full overwrite of the local_value field.

Parameters
Name Description
request UpdateSettingRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSetting

A Task containing the RPC response.

Example
// Create client
ResourceSettingsServiceClient resourceSettingsServiceClient = await ResourceSettingsServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateSettingRequest request = new UpdateSettingRequest
{
    Setting = new Setting(),
};
// Make the request
Setting response = await resourceSettingsServiceClient.UpdateSettingAsync(request);

UpdateSettingAsync(UpdateSettingRequest, CancellationToken)

public virtual Task<Setting> UpdateSettingAsync(UpdateSettingRequest request, CancellationToken cancellationToken)

Updates a setting.

Returns a google.rpc.Status with google.rpc.Code.NOT_FOUND if the setting does not exist. Returns a google.rpc.Status with google.rpc.Code.FAILED_PRECONDITION if the setting is flagged as read only. Returns a google.rpc.Status with google.rpc.Code.ABORTED if the etag supplied in the request does not match the persisted etag of the setting value.

On success, the response will contain only name, local_value and etag. The metadata and effective_value cannot be updated through this API.

Note: the supplied setting will perform a full overwrite of the local_value field.

Parameters
Name Description
request UpdateSettingRequest

The request object containing all of the parameters for the API call.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskSetting

A Task containing the RPC response.

Example
// Create client
ResourceSettingsServiceClient resourceSettingsServiceClient = await ResourceSettingsServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateSettingRequest request = new UpdateSettingRequest
{
    Setting = new Setting(),
};
// Make the request
Setting response = await resourceSettingsServiceClient.UpdateSettingAsync(request);