public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.Glacier.Model.SetVaultNotificationsRequest(); if (cmdletContext.AccountId != null) { request.AccountId = cmdletContext.AccountId; } if (cmdletContext.VaultName != null) { request.VaultName = cmdletContext.VaultName; } if (cmdletContext.VaultNotificationConfig != null) { request.VaultNotificationConfig = cmdletContext.VaultNotificationConfig; } CmdletOutput output; // issue call var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; pipelineOutput = cmdletContext.Select(response, this); output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } return(output); }
/// <summary> /// Initiates the asynchronous execution of the SetVaultNotifications operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the SetVaultNotifications operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public Task<SetVaultNotificationsResponse> SetVaultNotificationsAsync(SetVaultNotificationsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new SetVaultNotificationsRequestMarshaller(); var unmarshaller = SetVaultNotificationsResponseUnmarshaller.Instance; return InvokeAsync<SetVaultNotificationsRequest,SetVaultNotificationsResponse>(request, marshaller, unmarshaller, cancellationToken); }
internal SetVaultNotificationsResponse SetVaultNotifications(SetVaultNotificationsRequest request) { var marshaller = new SetVaultNotificationsRequestMarshaller(); var unmarshaller = SetVaultNotificationsResponseUnmarshaller.Instance; return Invoke<SetVaultNotificationsRequest,SetVaultNotificationsResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the SetVaultNotifications operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the SetVaultNotifications operation on AmazonGlacierClient.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> /// /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndSetVaultNotifications /// operation.</returns> public IAsyncResult BeginSetVaultNotifications(SetVaultNotificationsRequest request, AsyncCallback callback, object state) { var marshaller = new SetVaultNotificationsRequestMarshaller(); var unmarshaller = SetVaultNotificationsResponseUnmarshaller.Instance; return BeginInvoke<SetVaultNotificationsRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Initiates the asynchronous execution of the SetVaultNotifications operation. /// <seealso cref="Amazon.Glacier.IAmazonGlacier.SetVaultNotifications"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the SetVaultNotifications operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public Task<SetVaultNotificationsResponse> SetVaultNotificationsAsync(SetVaultNotificationsRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new SetVaultNotificationsRequestMarshaller(); var unmarshaller = SetVaultNotificationsResponseUnmarshaller.GetInstance(); return Invoke<IRequest, SetVaultNotificationsRequest, SetVaultNotificationsResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// <para>This operation configures notifications that will be sent when specific events happen to a vault. By default, you don't get any /// notifications. </para> <para>To configure vault notifications, send a PUT request to the <c>notification-configuration</c> subresource of /// the vault. The request should include a JSON document that provides an Amazon SNS topic and specific events for which you want Amazon /// Glacier to send notifications to the topic.</para> <para>Amazon SNS topics must grant permission to the vault to be allowed to publish /// notifications to the topic. You can configure a vault to publish a notification for the following vault events:</para> /// <ul> /// <li> <b>ArchiveRetrievalCompleted</b> This event occurs when a job that was initiated for an archive retrieval is completed (InitiateJob). /// The status of the completed job can be "Succeeded" or "Failed". The notification sent to the SNS topic is the same output as returned from /// DescribeJob. </li> /// <li> <b>InventoryRetrievalCompleted</b> This event occurs when a job that was initiated for an inventory retrieval is completed /// (InitiateJob). The status of the completed job can be "Succeeded" or "Failed". The notification sent to the SNS topic is the same output as /// returned from DescribeJob. </li> /// /// </ul> /// <para>An AWS account has full permission to perform all operations (actions). However, AWS Identity and Access Management (IAM) users don't /// have any permissions by default. You must grant them explicit permission to perform specific actions. For more information, see <a href="http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html">Access Control Using AWS Identity and Access /// Management (IAM)</a> .</para> <para>For conceptual information and underlying REST API, go to <a href="http://docs.aws.amazon.com/amazonglacier/latest/dev/configuring-notifications.html">Configuring Vault Notifications in Amazon /// Glacier</a> and <a href="http://docs.aws.amazon.com/amazonglacier/latest/dev/api-vault-notifications-put.html">Set Vault Notification /// Configuration </a> in the <i>Amazon Glacier Developer Guide</i> . /// </para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the SetVaultNotifications service method on /// AmazonGlacier.</param> /// /// <exception cref="T:Amazon.Glacier.Model.ResourceNotFoundException" /> /// <exception cref="T:Amazon.Glacier.Model.MissingParameterValueException" /> /// <exception cref="T:Amazon.Glacier.Model.ServiceUnavailableException" /> /// <exception cref="T:Amazon.Glacier.Model.InvalidParameterValueException" /> public SetVaultNotificationsResponse SetVaultNotifications(SetVaultNotificationsRequest request) { var task = SetVaultNotificationsAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// Initiates the asynchronous execution of the SetVaultNotifications operation. /// <seealso cref="Amazon.Glacier.AmazonGlacier.SetVaultNotifications"/> /// </summary> /// /// <param name="setVaultNotificationsRequest">Container for the necessary parameters to execute the SetVaultNotifications operation on /// AmazonGlacier.</param> /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param> /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback /// procedure using the AsyncState property.</param> public IAsyncResult BeginSetVaultNotifications(SetVaultNotificationsRequest setVaultNotificationsRequest, AsyncCallback callback, object state) { return invokeSetVaultNotifications(setVaultNotificationsRequest, callback, state, false); }
IAsyncResult invokeSetVaultNotifications(SetVaultNotificationsRequest setVaultNotificationsRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new SetVaultNotificationsRequestMarshaller().Marshall(setVaultNotificationsRequest); var unmarshaller = SetVaultNotificationsResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// <para>This operation configures notifications that will be sent when specific events happen to a vault. By default, you don't get any /// notifications. </para> <para>To configure vault notifications, send a PUT request to the <c>notification-configuration</c> subresource of /// the vault. The request should include a JSON document that provides an Amazon SNS topic and specific events for which you want Amazon /// Glacier to send notifications to the topic.</para> <para>Amazon SNS topics must grant permission to the vault to be allowed to publish /// notifications to the topic. You can configure a vault to publish a notification for the following vault events:</para> /// <ul> /// <li> <b>ArchiveRetrievalCompleted</b> This event occurs when a job that was initiated for an archive retrieval is completed (InitiateJob). /// The status of the completed job can be "Succeeded" or "Failed". The notification sent to the SNS topic is the same output as returned from /// DescribeJob. </li> /// <li> <b>InventoryRetrievalCompleted</b> This event occurs when a job that was initiated for an inventory retrieval is completed /// (InitiateJob). The status of the completed job can be "Succeeded" or "Failed". The notification sent to the SNS topic is the same output as /// returned from DescribeJob. </li> /// /// </ul> /// <para>An AWS account has full permission to perform all operations (actions). However, AWS Identity and Access Management (IAM) users don't /// have any permissions by default. You must grant them explicit permission to perform specific actions. For more information, see Access /// Control Using AWS Identity and Access Management (IAM).</para> <para>For conceptual information and underlying REST API, go to Configuring /// Vault Notifications in Amazon Glacier and Set Vault Notification Configuration in the <i>Amazon Glacier Developer Guide</i> . /// </para> /// </summary> /// /// <param name="setVaultNotificationsRequest">Container for the necessary parameters to execute the SetVaultNotifications service method on /// AmazonGlacier.</param> /// /// <exception cref="ResourceNotFoundException"/> /// <exception cref="MissingParameterValueException"/> /// <exception cref="ServiceUnavailableException"/> /// <exception cref="InvalidParameterValueException"/> public SetVaultNotificationsResponse SetVaultNotifications(SetVaultNotificationsRequest setVaultNotificationsRequest) { IAsyncResult asyncResult = invokeSetVaultNotifications(setVaultNotificationsRequest, null, null, true); return EndSetVaultNotifications(asyncResult); }
/// <summary> /// <para>This operation configures notifications that will be sent when specific events happen to a vault. By default, you don't get any /// notifications. </para> <para>To configure vault notifications, send a PUT request to the <c>notification-configuration</c> subresource of /// the vault. The request should include a JSON document that provides an Amazon SNS topic and specific events for which you want Amazon /// Glacier to send notifications to the topic.</para> <para>Amazon SNS topics must grant permission to the vault to be allowed to publish /// notifications to the topic. You can configure a vault to publish a notification for the following vault events:</para> /// <ul> /// <li> <b>ArchiveRetrievalCompleted</b> This event occurs when a job that was initiated for an archive retrieval is completed (InitiateJob). /// The status of the completed job can be "Succeeded" or "Failed". The notification sent to the SNS topic is the same output as returned from /// DescribeJob. </li> /// <li> <b>InventoryRetrievalCompleted</b> This event occurs when a job that was initiated for an inventory retrieval is completed /// (InitiateJob). The status of the completed job can be "Succeeded" or "Failed". The notification sent to the SNS topic is the same output as /// returned from DescribeJob. </li> /// /// </ul> /// <para>An AWS account has full permission to perform all operations (actions). However, AWS Identity and Access Management (IAM) users don't /// have any permissions by default. You must grant them explicit permission to perform specific actions. For more information, see <a href="http://docs.aws.amazon.com/amazonglacier/latest/dev/using-iam-with-amazon-glacier.html">Access Control Using AWS Identity and Access /// Management (IAM)</a> .</para> <para>For conceptual information and underlying REST API, go to <a href="http://docs.aws.amazon.com/amazonglacier/latest/dev/configuring-notifications.html">Configuring Vault Notifications in Amazon /// Glacier</a> and <a href="http://docs.aws.amazon.com/amazonglacier/latest/dev/api-vault-notifications-put.html">Set Vault Notification /// Configuration </a> in the <i>Amazon Glacier Developer Guide</i> . /// </para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the SetVaultNotifications service method on /// AmazonGlacier.</param> /// /// <exception cref="T:Amazon.Glacier.Model.ResourceNotFoundException" /> /// <exception cref="T:Amazon.Glacier.Model.MissingParameterValueException" /> /// <exception cref="T:Amazon.Glacier.Model.ServiceUnavailableException" /> /// <exception cref="T:Amazon.Glacier.Model.InvalidParameterValueException" /> public SetVaultNotificationsResponse SetVaultNotifications(SetVaultNotificationsRequest request) { var task = SetVaultNotificationsAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
private Amazon.Glacier.Model.SetVaultNotificationsResponse CallAWSServiceOperation(IAmazonGlacier client, Amazon.Glacier.Model.SetVaultNotificationsRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Glacier", "SetVaultNotifications"); try { #if DESKTOP return(client.SetVaultNotifications(request)); #elif CORECLR return(client.SetVaultNotificationsAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }
/// <summary> /// Initiates the asynchronous execution of the SetVaultNotifications operation. /// <seealso cref="Amazon.Glacier.IAmazonGlacier.SetVaultNotifications"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the SetVaultNotifications operation.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// <returns>The task object representing the asynchronous operation.</returns> public async Task<SetVaultNotificationsResponse> SetVaultNotificationsAsync(SetVaultNotificationsRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new SetVaultNotificationsRequestMarshaller(); var unmarshaller = SetVaultNotificationsResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, SetVaultNotificationsRequest, SetVaultNotificationsResponse>(request, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }