Exemplo n.º 1
0
        private void HandleOutput(GetIdpGroupMappingRequest request)
        {
            var waiterConfig = new WaiterConfiguration
            {
                MaxAttempts           = MaxWaitAttempts,
                GetNextDelayInSeconds = (_) => WaitIntervalSeconds
            };

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

            case Default:
                response = client.GetIdpGroupMapping(request).GetAwaiter().GetResult();
                break;
            }
            WriteOutput(response, response.IdpGroupMapping);
        }
Exemplo n.º 2
0
        protected override void ProcessRecord()
        {
            base.ProcessRecord();
            GetIdpGroupMappingRequest request;

            try
            {
                request = new GetIdpGroupMappingRequest
                {
                    IdentityProviderId = IdentityProviderId,
                    MappingId          = MappingId
                };

                HandleOutput(request);
                FinishProcessing(response);
            }
            catch (Exception ex)
            {
                TerminatingErrorDuringExecution(ex);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Creates a waiter using the provided configuration.
        /// </summary>
        /// <param name="request">Request to send.</param>
        /// <param name="config">Wait Configuration</param>
        /// <param name="targetStates">Desired resource states. If multiple states are provided then the waiter will return once the resource reaches any of the provided states</param>
        /// <returns>a new Oci.common.Waiter instance</returns>
        public Waiter <GetIdpGroupMappingRequest, GetIdpGroupMappingResponse> ForIdpGroupMapping(GetIdpGroupMappingRequest request, WaiterConfiguration config, params IdpGroupMapping.LifecycleStateEnum[] targetStates)
        {
            var agent = new WaiterAgent <GetIdpGroupMappingRequest, GetIdpGroupMappingResponse>(
                request,
                request => client.GetIdpGroupMapping(request),
                response => targetStates.Contains(response.IdpGroupMapping.LifecycleState.Value),
                targetStates.Contains(IdpGroupMapping.LifecycleStateEnum.Deleted)
                );

            return(new Waiter <GetIdpGroupMappingRequest, GetIdpGroupMappingResponse>(config, agent));
        }
Exemplo n.º 4
0
 /// <summary>
 /// Creates a waiter using default wait configuration.
 /// </summary>
 /// <param name="request">Request to send.</param>
 /// <param name="targetStates">Desired resource states. If multiple states are provided then the waiter will return once the resource reaches any of the provided states</param>
 /// <returns>a new Oci.common.Waiter instance</returns>
 public Waiter <GetIdpGroupMappingRequest, GetIdpGroupMappingResponse> ForIdpGroupMapping(GetIdpGroupMappingRequest request, params IdpGroupMapping.LifecycleStateEnum[] targetStates)
 {
     return(this.ForIdpGroupMapping(request, WaiterConfiguration.DefaultWaiterConfiguration, targetStates));
 }