Пример #1
0
        private void HandleOutput(GetAnnouncementSubscriptionRequest request)
        {
            var waiterConfig = new WaiterConfiguration
            {
                MaxAttempts           = MaxWaitAttempts,
                GetNextDelayInSeconds = (_) => WaitIntervalSeconds
            };

            switch (ParameterSetName)
            {
            case LifecycleStateParamSet:
                response = client.Waiters.ForAnnouncementSubscription(request, waiterConfig, WaitForLifecycleState).Execute();
                break;

            case Default:
                response = client.GetAnnouncementSubscription(request).GetAwaiter().GetResult();
                break;
            }
            WriteOutput(response, response.AnnouncementSubscription);
        }
Пример #2
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            GetAnnouncementSubscriptionRequest request;

            try
            {
                request = new GetAnnouncementSubscriptionRequest
                {
                    AnnouncementSubscriptionId = AnnouncementSubscriptionId,
                    OpcRequestId = OpcRequestId
                };

                HandleOutput(request);
                FinishProcessing(response);
            }
            catch (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }