|
| 1 | +/* |
| 2 | + * NOTE: Generated using OracleSDKGenerator, API Version: 20221109 |
| 3 | + * DO NOT EDIT this file manually. |
| 4 | + * |
| 5 | + * Copyright (c) 2020, 2024, Oracle and/or its affiliates. |
| 6 | + * This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. |
| 7 | + */ |
| 8 | + |
| 9 | +using System; |
| 10 | +using System.Management.Automation; |
| 11 | +using Oci.AidocumentService.Requests; |
| 12 | +using Oci.AidocumentService.Responses; |
| 13 | +using Oci.AidocumentService.Models; |
| 14 | +using Oci.Common.Model; |
| 15 | + |
| 16 | +namespace Oci.AidocumentService.Cmdlets |
| 17 | +{ |
| 18 | + [Cmdlet("Remove", "OCIAidocumentModelLock")] |
| 19 | + [OutputType(new System.Type[] { typeof(Oci.AidocumentService.Models.Model), typeof(Oci.AidocumentService.Responses.RemoveModelLockResponse) })] |
| 20 | + public class RemoveOCIAidocumentModelLock : OCIAIServiceDocumentCmdlet |
| 21 | + { |
| 22 | + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = @"A unique model identifier.")] |
| 23 | + public string ModelId { get; set; } |
| 24 | + |
| 25 | + [Parameter(Mandatory = true, ValueFromPipelineByPropertyName = true, HelpMessage = @"Request payload to remove lock to the resource.")] |
| 26 | + public RemoveModelLockDetails RemoveModelLockDetails { get; set; } |
| 27 | + |
| 28 | + [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = @"A token that uniquely identifies a request so it can be retried in case of a timeout or server error without the risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.")] |
| 29 | + public string OpcRetryToken { get; set; } |
| 30 | + |
| 31 | + [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = @"The client request ID for tracing.")] |
| 32 | + public string OpcRequestId { get; set; } |
| 33 | + |
| 34 | + [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = @"For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.")] |
| 35 | + public string IfMatch { get; set; } |
| 36 | + |
| 37 | + [Parameter(Mandatory = false, ValueFromPipelineByPropertyName = true, HelpMessage = @"Whether to override locks (if any exist).")] |
| 38 | + public System.Nullable<bool> IsLockOverride { get; set; } |
| 39 | + |
| 40 | + protected override void ProcessRecord() |
| 41 | + { |
| 42 | + base.ProcessRecord(); |
| 43 | + RemoveModelLockRequest request; |
| 44 | + |
| 45 | + try |
| 46 | + { |
| 47 | + request = new RemoveModelLockRequest |
| 48 | + { |
| 49 | + ModelId = ModelId, |
| 50 | + RemoveModelLockDetails = RemoveModelLockDetails, |
| 51 | + OpcRetryToken = OpcRetryToken, |
| 52 | + OpcRequestId = OpcRequestId, |
| 53 | + IfMatch = IfMatch, |
| 54 | + IsLockOverride = IsLockOverride |
| 55 | + }; |
| 56 | + |
| 57 | + response = client.RemoveModelLock(request).GetAwaiter().GetResult(); |
| 58 | + WriteOutput(response, response.Model); |
| 59 | + FinishProcessing(response); |
| 60 | + } |
| 61 | + catch (OciException ex) |
| 62 | + { |
| 63 | + TerminatingErrorDuringExecution(ex); |
| 64 | + } |
| 65 | + catch (Exception ex) |
| 66 | + { |
| 67 | + TerminatingErrorDuringExecution(ex); |
| 68 | + } |
| 69 | + } |
| 70 | + |
| 71 | + protected override void StopProcessing() |
| 72 | + { |
| 73 | + base.StopProcessing(); |
| 74 | + TerminatingErrorDuringExecution(new OperationCanceledException("Cmdlet execution interrupted")); |
| 75 | + } |
| 76 | + |
| 77 | + private RemoveModelLockResponse response; |
| 78 | + } |
| 79 | +} |
0 commit comments