Skip to content

Commit

Permalink
feat!: Remove EnableService and DisableService RPC methods and relate…
Browse files Browse the repository at this point in the history
…d protos from service management API

BREAKING CHANGE:

PiperOrigin-RevId: 428693468

Source-Link: googleapis/googleapis@42a19d6

Source-Link: googleapis/googleapis-gen@58bcf19
Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuU2VydmljZU1hbmFnZW1lbnQuVjEvLk93bEJvdC55YW1sIiwiaCI6IjU4YmNmMTkzNWVjYjJiZGRlYTBiNjNjYjAzYjhhOGJjNTVlMTc2OWYifQ==
  • Loading branch information
gcf-owl-bot[bot] authored and jskeet committed Feb 15, 2022
1 parent 8489040 commit d5cb1ab
Show file tree
Hide file tree
Showing 6 changed files with 278 additions and 2,035 deletions.
Expand Up @@ -1522,293 +1522,5 @@ public async Task GenerateConfigReportAsync()
GenerateConfigReportResponse response = await serviceManagerClient.GenerateConfigReportAsync(newConfig, oldConfig);
// End snippet
}

/// <summary>Snippet for EnableService</summary>
public void EnableServiceRequestObject()
{
// Snippet: EnableService(EnableServiceRequest, CallSettings)
// Create client
ServiceManagerClient serviceManagerClient = ServiceManagerClient.Create();
// Initialize request argument(s)
EnableServiceRequest request = new EnableServiceRequest
{
ServiceName = "",
ConsumerId = "",
};
// Make the request
#pragma warning disable CS0612
Operation<EnableServiceResponse, OperationMetadata> response = serviceManagerClient.EnableService(request);
#pragma warning restore CS0612

// Poll until the returned long-running operation is complete
Operation<EnableServiceResponse, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
EnableServiceResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
#pragma warning disable CS0612
Operation<EnableServiceResponse, OperationMetadata> retrievedResponse = serviceManagerClient.PollOnceEnableService(operationName);
#pragma warning restore CS0612
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
EnableServiceResponse retrievedResult = retrievedResponse.Result;
}
// End snippet
}

/// <summary>Snippet for EnableServiceAsync</summary>
public async Task EnableServiceRequestObjectAsync()
{
// Snippet: EnableServiceAsync(EnableServiceRequest, CallSettings)
// Additional: EnableServiceAsync(EnableServiceRequest, CancellationToken)
// Create client
ServiceManagerClient serviceManagerClient = await ServiceManagerClient.CreateAsync();
// Initialize request argument(s)
EnableServiceRequest request = new EnableServiceRequest
{
ServiceName = "",
ConsumerId = "",
};
// Make the request
#pragma warning disable CS0612
Operation<EnableServiceResponse, OperationMetadata> response = await serviceManagerClient.EnableServiceAsync(request);
#pragma warning restore CS0612

// Poll until the returned long-running operation is complete
Operation<EnableServiceResponse, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
EnableServiceResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
#pragma warning disable CS0612
Operation<EnableServiceResponse, OperationMetadata> retrievedResponse = await serviceManagerClient.PollOnceEnableServiceAsync(operationName);
#pragma warning restore CS0612
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
EnableServiceResponse retrievedResult = retrievedResponse.Result;
}
// End snippet
}

/// <summary>Snippet for EnableService</summary>
public void EnableService()
{
// Snippet: EnableService(string, string, CallSettings)
// Create client
ServiceManagerClient serviceManagerClient = ServiceManagerClient.Create();
// Initialize request argument(s)
string serviceName = "";
string consumerId = "";
// Make the request
#pragma warning disable CS0612
Operation<EnableServiceResponse, OperationMetadata> response = serviceManagerClient.EnableService(serviceName, consumerId);
#pragma warning restore CS0612

// Poll until the returned long-running operation is complete
Operation<EnableServiceResponse, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
EnableServiceResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
#pragma warning disable CS0612
Operation<EnableServiceResponse, OperationMetadata> retrievedResponse = serviceManagerClient.PollOnceEnableService(operationName);
#pragma warning restore CS0612
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
EnableServiceResponse retrievedResult = retrievedResponse.Result;
}
// End snippet
}

/// <summary>Snippet for EnableServiceAsync</summary>
public async Task EnableServiceAsync()
{
// Snippet: EnableServiceAsync(string, string, CallSettings)
// Additional: EnableServiceAsync(string, string, CancellationToken)
// Create client
ServiceManagerClient serviceManagerClient = await ServiceManagerClient.CreateAsync();
// Initialize request argument(s)
string serviceName = "";
string consumerId = "";
// Make the request
#pragma warning disable CS0612
Operation<EnableServiceResponse, OperationMetadata> response = await serviceManagerClient.EnableServiceAsync(serviceName, consumerId);
#pragma warning restore CS0612

// Poll until the returned long-running operation is complete
Operation<EnableServiceResponse, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
EnableServiceResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
#pragma warning disable CS0612
Operation<EnableServiceResponse, OperationMetadata> retrievedResponse = await serviceManagerClient.PollOnceEnableServiceAsync(operationName);
#pragma warning restore CS0612
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
EnableServiceResponse retrievedResult = retrievedResponse.Result;
}
// End snippet
}

/// <summary>Snippet for DisableService</summary>
public void DisableServiceRequestObject()
{
// Snippet: DisableService(DisableServiceRequest, CallSettings)
// Create client
ServiceManagerClient serviceManagerClient = ServiceManagerClient.Create();
// Initialize request argument(s)
DisableServiceRequest request = new DisableServiceRequest
{
ServiceName = "",
ConsumerId = "",
};
// Make the request
#pragma warning disable CS0612
Operation<DisableServiceResponse, OperationMetadata> response = serviceManagerClient.DisableService(request);
#pragma warning restore CS0612

// Poll until the returned long-running operation is complete
Operation<DisableServiceResponse, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
DisableServiceResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
#pragma warning disable CS0612
Operation<DisableServiceResponse, OperationMetadata> retrievedResponse = serviceManagerClient.PollOnceDisableService(operationName);
#pragma warning restore CS0612
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
DisableServiceResponse retrievedResult = retrievedResponse.Result;
}
// End snippet
}

/// <summary>Snippet for DisableServiceAsync</summary>
public async Task DisableServiceRequestObjectAsync()
{
// Snippet: DisableServiceAsync(DisableServiceRequest, CallSettings)
// Additional: DisableServiceAsync(DisableServiceRequest, CancellationToken)
// Create client
ServiceManagerClient serviceManagerClient = await ServiceManagerClient.CreateAsync();
// Initialize request argument(s)
DisableServiceRequest request = new DisableServiceRequest
{
ServiceName = "",
ConsumerId = "",
};
// Make the request
#pragma warning disable CS0612
Operation<DisableServiceResponse, OperationMetadata> response = await serviceManagerClient.DisableServiceAsync(request);
#pragma warning restore CS0612

// Poll until the returned long-running operation is complete
Operation<DisableServiceResponse, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
DisableServiceResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
#pragma warning disable CS0612
Operation<DisableServiceResponse, OperationMetadata> retrievedResponse = await serviceManagerClient.PollOnceDisableServiceAsync(operationName);
#pragma warning restore CS0612
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
DisableServiceResponse retrievedResult = retrievedResponse.Result;
}
// End snippet
}

/// <summary>Snippet for DisableService</summary>
public void DisableService()
{
// Snippet: DisableService(string, string, CallSettings)
// Create client
ServiceManagerClient serviceManagerClient = ServiceManagerClient.Create();
// Initialize request argument(s)
string serviceName = "";
string consumerId = "";
// Make the request
#pragma warning disable CS0612
Operation<DisableServiceResponse, OperationMetadata> response = serviceManagerClient.DisableService(serviceName, consumerId);
#pragma warning restore CS0612

// Poll until the returned long-running operation is complete
Operation<DisableServiceResponse, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
DisableServiceResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
#pragma warning disable CS0612
Operation<DisableServiceResponse, OperationMetadata> retrievedResponse = serviceManagerClient.PollOnceDisableService(operationName);
#pragma warning restore CS0612
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
DisableServiceResponse retrievedResult = retrievedResponse.Result;
}
// End snippet
}

/// <summary>Snippet for DisableServiceAsync</summary>
public async Task DisableServiceAsync()
{
// Snippet: DisableServiceAsync(string, string, CallSettings)
// Additional: DisableServiceAsync(string, string, CancellationToken)
// Create client
ServiceManagerClient serviceManagerClient = await ServiceManagerClient.CreateAsync();
// Initialize request argument(s)
string serviceName = "";
string consumerId = "";
// Make the request
#pragma warning disable CS0612
Operation<DisableServiceResponse, OperationMetadata> response = await serviceManagerClient.DisableServiceAsync(serviceName, consumerId);
#pragma warning restore CS0612

// Poll until the returned long-running operation is complete
Operation<DisableServiceResponse, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
DisableServiceResponse result = completedResponse.Result;

// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
#pragma warning disable CS0612
Operation<DisableServiceResponse, OperationMetadata> retrievedResponse = await serviceManagerClient.PollOnceDisableServiceAsync(operationName);
#pragma warning restore CS0612
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
DisableServiceResponse retrievedResult = retrievedResponse.Result;
}
// End snippet
}
}
}
Expand Up @@ -146,7 +146,7 @@ public sealed partial class ManagedService : pb::IMessage<ManagedService>
public const int ServiceNameFieldNumber = 2;
private string serviceName_ = "";
/// <summary>
/// The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
/// The name of the service. See the [overview](/service-management/overview)
/// for naming requirements.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
Expand Down

0 comments on commit d5cb1ab

Please sign in to comment.