Skip to content

Commit

Permalink
feat: A new method CheckUpgrade is added to service Environments
Browse files Browse the repository at this point in the history
feat: A new field `satisfies_pzi` is added to message `.google.cloud.orchestration.airflow.service.v1.Environment`
feat: A new message `CheckUpgradeRequest` is added
feat: A new field `airflow_metadata_retention_config` is added to message `.google.cloud.orchestration.airflow.service.v1.DataRetentionConfig`
feat: A new message `AirflowMetadataRetentionPolicyConfig` is added
docs: A comment for field `maintenance_window` in message `.google.cloud.orchestration.airflow.service.v1.EnvironmentConfig` is changed
docs: A comment for message `WorkloadsConfig` is changed
docs: A comment for field `storage_mode` in message `.google.cloud.orchestration.airflow.service.v1.TaskLogsRetentionConfig` is changed

PiperOrigin-RevId: 673766368

Source-Link: googleapis/googleapis@0f44538

Source-Link: googleapis/googleapis-gen@802f7c8
Copy-Tag: eyJwIjoiYXBpcy9Hb29nbGUuQ2xvdWQuT3JjaGVzdHJhdGlvbi5BaXJmbG93LlNlcnZpY2UuVjEvLk93bEJvdC55YW1sIiwiaCI6IjgwMmY3YzhjZGY4ODc1MjdlOTlmYTljMGQ3NzRhZGZkMzNhMTZmZmUifQ==
  • Loading branch information
gcf-owl-bot[bot] authored and jskeet committed Sep 12, 2024
1 parent dabdcad commit a8d79de
Show file tree
Hide file tree
Showing 8 changed files with 1,337 additions and 188 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Generated code. DO NOT EDIT!

namespace GoogleCSharpSnippets
{
// [START composer_v1_generated_Environments_CheckUpgrade_async]
using Google.Cloud.Orchestration.Airflow.Service.V1;
using Google.LongRunning;
using System.Threading.Tasks;

public sealed partial class GeneratedEnvironmentsClientSnippets
{
/// <summary>Snippet for CheckUpgradeAsync</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public async Task CheckUpgradeRequestObjectAsync()
{
// Create client
EnvironmentsClient environmentsClient = await EnvironmentsClient.CreateAsync();
// Initialize request argument(s)
CheckUpgradeRequest request = new CheckUpgradeRequest
{
Environment = "",
ImageVersion = "",
};
// Make the request
Operation<CheckUpgradeResponse, OperationMetadata> response = await environmentsClient.CheckUpgradeAsync(request);

// Poll until the returned long-running operation is complete
Operation<CheckUpgradeResponse, OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
CheckUpgradeResponse 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
Operation<CheckUpgradeResponse, OperationMetadata> retrievedResponse = await environmentsClient.PollOnceCheckUpgradeAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
CheckUpgradeResponse retrievedResult = retrievedResponse.Result;
}
}
}
// [END composer_v1_generated_Environments_CheckUpgrade_async]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Generated code. DO NOT EDIT!

namespace GoogleCSharpSnippets
{
// [START composer_v1_generated_Environments_CheckUpgrade_sync]
using Google.Cloud.Orchestration.Airflow.Service.V1;
using Google.LongRunning;

public sealed partial class GeneratedEnvironmentsClientSnippets
{
/// <summary>Snippet for CheckUpgrade</summary>
/// <remarks>
/// This snippet has been automatically generated and should be regarded as a code template only.
/// It will require modifications to work:
/// - It may require correct/in-range values for request initialization.
/// - It may require specifying regional endpoints when creating the service client as shown in
/// https://cloud.google.com/dotnet/docs/reference/help/client-configuration#endpoint.
/// </remarks>
public void CheckUpgradeRequestObject()
{
// Create client
EnvironmentsClient environmentsClient = EnvironmentsClient.Create();
// Initialize request argument(s)
CheckUpgradeRequest request = new CheckUpgradeRequest
{
Environment = "",
ImageVersion = "",
};
// Make the request
Operation<CheckUpgradeResponse, OperationMetadata> response = environmentsClient.CheckUpgrade(request);

// Poll until the returned long-running operation is complete
Operation<CheckUpgradeResponse, OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
CheckUpgradeResponse 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
Operation<CheckUpgradeResponse, OperationMetadata> retrievedResponse = environmentsClient.PollOnceCheckUpgrade(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
CheckUpgradeResponse retrievedResult = retrievedResponse.Result;
}
}
}
// [END composer_v1_generated_Environments_CheckUpgrade_sync]
}
Original file line number Diff line number Diff line change
Expand Up @@ -1620,6 +1620,103 @@
}
]
},
{
"regionTag": "composer_v1_generated_Environments_CheckUpgrade_sync",
"title": "CheckUpgradeRequestObject",
"description": "Snippet for CheckUpgrade",
"file": "EnvironmentsClient.CheckUpgradeRequestObjectSnippet.g.cs",
"language": "C_SHARP",
"clientMethod": {
"shortName": "CheckUpgrade",
"fullName": "Google.Cloud.Orchestration.Airflow.Service.V1.EnvironmentsClient.CheckUpgrade",
"parameters": [
{
"type": "Google.Cloud.Orchestration.Airflow.Service.V1.CheckUpgradeRequest",
"name": "request"
},
{
"type": "Google.Api.Gax.Grpc.CallSettings",
"name": "callSettings"
}
],
"resultType": "Google.LongRunning.Operation<Google.Cloud.Orchestration.Airflow.Service.V1.CheckUpgradeResponse, Google.Cloud.Orchestration.Airflow.Service.V1.OperationMetadata>",
"client": {
"shortName": "EnvironmentsClient",
"fullName": "Google.Cloud.Orchestration.Airflow.Service.V1.EnvironmentsClient"
},
"method": {
"shortName": "CheckUpgrade",
"fullName": "google.cloud.orchestration.airflow.service.v1.Environments.CheckUpgrade",
"service": {
"shortName": "Environments",
"fullName": "google.cloud.orchestration.airflow.service.v1.Environments"
}
}
},
"canonical": true,
"origin": "API_DEFINITION",
"segments": [
{
"start": 20,
"end": 62,
"type": "FULL"
},
{
"start": 35,
"end": 60,
"type": "SHORT"
}
]
},
{
"regionTag": "composer_v1_generated_Environments_CheckUpgrade_async",
"title": "CheckUpgradeRequestObjectAsync",
"description": "Snippet for CheckUpgradeAsync",
"file": "EnvironmentsClient.CheckUpgradeRequestObjectAsyncSnippet.g.cs",
"language": "C_SHARP",
"clientMethod": {
"shortName": "CheckUpgradeAsync",
"fullName": "Google.Cloud.Orchestration.Airflow.Service.V1.EnvironmentsClient.CheckUpgradeAsync",
"async": true,
"parameters": [
{
"type": "Google.Cloud.Orchestration.Airflow.Service.V1.CheckUpgradeRequest",
"name": "request"
},
{
"type": "Google.Api.Gax.Grpc.CallSettings",
"name": "callSettings"
}
],
"resultType": "System.Threading.Tasks.Task<Google.LongRunning.Operation<Google.Cloud.Orchestration.Airflow.Service.V1.CheckUpgradeResponse, Google.Cloud.Orchestration.Airflow.Service.V1.OperationMetadata>>",
"client": {
"shortName": "EnvironmentsClient",
"fullName": "Google.Cloud.Orchestration.Airflow.Service.V1.EnvironmentsClient"
},
"method": {
"shortName": "CheckUpgrade",
"fullName": "google.cloud.orchestration.airflow.service.v1.Environments.CheckUpgrade",
"service": {
"shortName": "Environments",
"fullName": "google.cloud.orchestration.airflow.service.v1.Environments"
}
}
},
"canonical": true,
"origin": "API_DEFINITION",
"segments": [
{
"start": 20,
"end": 63,
"type": "FULL"
},
{
"start": 36,
"end": 61,
"type": "SHORT"
}
]
},
{
"regionTag": "composer_v1_generated_Environments_CreateUserWorkloadsSecret_sync",
"title": "CreateUserWorkloadsSecretRequestObject",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,73 @@ await response.AsRawResponses().ForEachAsync((gcoasv::ListWorkloadsResponse page
// End snippet
}

/// <summary>Snippet for CheckUpgrade</summary>
public void CheckUpgradeRequestObject()
{
// Snippet: CheckUpgrade(CheckUpgradeRequest, CallSettings)
// Create client
gcoasv::EnvironmentsClient environmentsClient = gcoasv::EnvironmentsClient.Create();
// Initialize request argument(s)
gcoasv::CheckUpgradeRequest request = new gcoasv::CheckUpgradeRequest
{
Environment = "",
ImageVersion = "",
};
// Make the request
Operation<gcoasv::CheckUpgradeResponse, gcoasv::OperationMetadata> response = environmentsClient.CheckUpgrade(request);

// Poll until the returned long-running operation is complete
Operation<gcoasv::CheckUpgradeResponse, gcoasv::OperationMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
gcoasv::CheckUpgradeResponse 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
Operation<gcoasv::CheckUpgradeResponse, gcoasv::OperationMetadata> retrievedResponse = environmentsClient.PollOnceCheckUpgrade(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcoasv::CheckUpgradeResponse retrievedResult = retrievedResponse.Result;
}
// End snippet
}

/// <summary>Snippet for CheckUpgradeAsync</summary>
public async Task CheckUpgradeRequestObjectAsync()
{
// Snippet: CheckUpgradeAsync(CheckUpgradeRequest, CallSettings)
// Additional: CheckUpgradeAsync(CheckUpgradeRequest, CancellationToken)
// Create client
gcoasv::EnvironmentsClient environmentsClient = await gcoasv::EnvironmentsClient.CreateAsync();
// Initialize request argument(s)
gcoasv::CheckUpgradeRequest request = new gcoasv::CheckUpgradeRequest
{
Environment = "",
ImageVersion = "",
};
// Make the request
Operation<gcoasv::CheckUpgradeResponse, gcoasv::OperationMetadata> response = await environmentsClient.CheckUpgradeAsync(request);

// Poll until the returned long-running operation is complete
Operation<gcoasv::CheckUpgradeResponse, gcoasv::OperationMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
gcoasv::CheckUpgradeResponse 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
Operation<gcoasv::CheckUpgradeResponse, gcoasv::OperationMetadata> retrievedResponse = await environmentsClient.PollOnceCheckUpgradeAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
gcoasv::CheckUpgradeResponse retrievedResult = retrievedResponse.Result;
}
// End snippet
}

/// <summary>Snippet for CreateUserWorkloadsSecret</summary>
public void CreateUserWorkloadsSecretRequestObject()
{
Expand Down
Loading

0 comments on commit a8d79de

Please sign in to comment.