/// <summary> /// Creates or updates a rule. Rules are enabled by default, or based on value of the /// State parameter. You can disable a rule using <a>DisableRule</a>. /// /// /// <para> /// <b>Note:</b> When you create or update a rule, incoming events might not immediately /// start matching to new or updated rules. Please allow a short period of time for changes /// to take effect. /// </para> /// /// <para> /// A rule must contain at least an EventPattern or ScheduleExpression. Rules with EventPatterns /// are triggered when a matching event is observed. Rules with ScheduleExpressions self-trigger /// based on the given schedule. A rule can have both an EventPattern and a ScheduleExpression, /// in which case the rule will trigger on matching events as well as on a schedule. /// </para> /// /// <para> /// <b>Note:</b> Most services in AWS treat : or / as the same character in Amazon Resource /// Names (ARNs). However, CloudWatch Events uses an exact match in event patterns and /// rules. Be sure to use the correct ARN characters when creating event patterns so that /// they match the ARN syntax in the event you want to match. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the PutRule service method.</param> /// /// <returns>The response from the PutRule service method, as returned by CloudWatchEvents.</returns> /// <exception cref="Amazon.CloudWatchEvents.Model.ConcurrentModificationException"> /// This exception occurs if there is concurrent modification on rule or target. /// </exception> /// <exception cref="Amazon.CloudWatchEvents.Model.InternalException"> /// This exception occurs due to unexpected causes. /// </exception> /// <exception cref="Amazon.CloudWatchEvents.Model.InvalidEventPatternException"> /// The event pattern is invalid. /// </exception> /// <exception cref="Amazon.CloudWatchEvents.Model.LimitExceededException"> /// This exception occurs if you try to create more rules or add more targets to a rule /// than allowed by default. /// </exception> public PutRuleResponse PutRule(PutRuleRequest request) { var marshaller = new PutRuleRequestMarshaller(); var unmarshaller = PutRuleResponseUnmarshaller.Instance; return(Invoke <PutRuleRequest, PutRuleResponse>(request, marshaller, unmarshaller)); }
public void PutRuleMarshallTest() { var request = InstantiateClassGenerator.Execute <PutRuleRequest>(); var marshaller = new PutRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson <PutRuleRequest>(request, jsonRequest); var webResponse = new WebResponseData { Headers = { { "x-amzn-RequestId", Guid.NewGuid().ToString() }, { "x-amz-crc32", "0" } } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("PutRule").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = PutRuleResponseUnmarshaller.Instance.Unmarshall(context) as PutRuleResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
/// <summary> /// Initiates the asynchronous execution of the PutRule operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the PutRule 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 <PutRuleResponse> PutRuleAsync(PutRuleRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new PutRuleRequestMarshaller(); var unmarshaller = PutRuleResponseUnmarshaller.Instance; return(InvokeAsync <PutRuleRequest, PutRuleResponse>(request, marshaller, unmarshaller, cancellationToken)); }
/// <summary> /// Initiates the asynchronous execution of the PutRule operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the PutRule operation on AmazonCloudWatchEventsClient.</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 EndPutRule /// operation.</returns> public IAsyncResult BeginPutRule(PutRuleRequest request, AsyncCallback callback, object state) { var marshaller = new PutRuleRequestMarshaller(); var unmarshaller = PutRuleResponseUnmarshaller.Instance; return BeginInvoke<PutRuleRequest>(request, marshaller, unmarshaller, callback, state); }
public void PutRuleMarshallTest() { var request = InstantiateClassGenerator.Execute<PutRuleRequest>(); var marshaller = new PutRuleRequestMarshaller(); var internalRequest = marshaller.Marshall(request); var jsonRequest = UTF8Encoding.UTF8.GetString(internalRequest.Content); Comparer.CompareObjectToJson<PutRuleRequest>(request,jsonRequest); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("PutRule").ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString()); UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse); var response = PutRuleResponseUnmarshaller.Instance.Unmarshall(context) as PutRuleResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
/// <summary> /// Initiates the asynchronous execution of the PutRule operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the PutRule 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<PutRuleResponse> PutRuleAsync(PutRuleRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new PutRuleRequestMarshaller(); var unmarshaller = PutRuleResponseUnmarshaller.Instance; return InvokeAsync<PutRuleRequest,PutRuleResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Creates or updates a rule. Rules are enabled by default, or based on value of the /// State parameter. You can disable a rule using <a>DisableRule</a>. /// /// /// <para> /// <b>Note:</b> When you create or update a rule, incoming events might not immediately /// start matching to new or updated rules. Please allow a short period of time for changes /// to take effect. /// </para> /// /// <para> /// A rule must contain at least an EventPattern or ScheduleExpression. Rules with EventPatterns /// are triggered when a matching event is observed. Rules with ScheduleExpressions self-trigger /// based on the given schedule. A rule can have both an EventPattern and a ScheduleExpression, /// in which case the rule will trigger on matching events as well as on a schedule. /// </para> /// /// <para> /// <b>Note:</b> Most services in AWS treat : or / as the same character in Amazon Resource /// Names (ARNs). However, CloudWatch Events uses an exact match in event patterns and /// rules. Be sure to use the correct ARN characters when creating event patterns so that /// they match the ARN syntax in the event you want to match. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the PutRule service method.</param> /// /// <returns>The response from the PutRule service method, as returned by CloudWatchEvents.</returns> /// <exception cref="Amazon.CloudWatchEvents.Model.ConcurrentModificationException"> /// This exception occurs if there is concurrent modification on rule or target. /// </exception> /// <exception cref="Amazon.CloudWatchEvents.Model.InternalException"> /// This exception occurs due to unexpected causes. /// </exception> /// <exception cref="Amazon.CloudWatchEvents.Model.InvalidEventPatternException"> /// The event pattern is invalid. /// </exception> /// <exception cref="Amazon.CloudWatchEvents.Model.LimitExceededException"> /// This exception occurs if you try to create more rules or add more targets to a rule /// than allowed by default. /// </exception> public PutRuleResponse PutRule(PutRuleRequest request) { var marshaller = new PutRuleRequestMarshaller(); var unmarshaller = PutRuleResponseUnmarshaller.Instance; return Invoke<PutRuleRequest,PutRuleResponse>(request, marshaller, unmarshaller); }