Container for the parameters to the GetGroup operation.

Returns a list of Users that are in the specified group. You can paginate the results using the MaxItems and Marker parameters.

Inheritance: Amazon.Runtime.AmazonWebServiceRequest
コード例 #1
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.IdentityManagement.Model.GetGroupRequest();

            if (cmdletContext.GroupName != null)
            {
                request.GroupName = cmdletContext.GroupName;
            }
            if (cmdletContext.Marker != null)
            {
                request.Marker = cmdletContext.Marker;
            }
            if (cmdletContext.MaxItem != null)
            {
                request.MaxItems = cmdletContext.MaxItem.Value;
            }

            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);
        }
        public async Task<Group> RetrieveGroup(
            string identifier, 
            IAmazonIdentityManagementService proxy)
        {
            if (null == identifier)
            {
                throw new ArgumentException(AnchoringByNameBehavior.ArgumentNameIdentifier);
            }

            if (null == proxy)
            {
                throw new ArgumentNullException(AnchoringByNameBehavior.ArgumentNameProxy);
            }

            GetGroupRequest request = new GetGroupRequest(identifier);
            GetGroupResult response = await proxy.GetGroupAsync(request);
            Group result = response.Group;
            return result;
        }
 /// <summary>
 /// <para>Returns a list of users that are in the specified group. You can paginate the results using the <c>MaxItems</c> and <c>Marker</c>
 /// parameters.</para>
 /// </summary>
 /// 
 /// <param name="getGroupRequest">Container for the necessary parameters to execute the GetGroup service method on
 ///          AmazonIdentityManagementService.</param>
 /// 
 /// <returns>The response from the GetGroup service method, as returned by AmazonIdentityManagementService.</returns>
 /// 
 /// <exception cref="NoSuchEntityException"/>
 public GetGroupResponse GetGroup(GetGroupRequest getGroupRequest)
 {
     IAsyncResult asyncResult = invokeGetGroup(getGroupRequest, null, null, true);
     return EndGetGroup(asyncResult);
 }
コード例 #4
0
        /// <summary>
        /// Initiates the asynchronous execution of the GetGroup operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the GetGroup operation on AmazonIdentityManagementServiceClient.</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 EndGetGroup
        ///         operation.</returns>
        public IAsyncResult BeginGetGroup(GetGroupRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new GetGroupRequestMarshaller();
            var unmarshaller = GetGroupResponseUnmarshaller.Instance;

            return BeginInvoke<GetGroupRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
コード例 #5
0
 /// <summary>
 /// Paginator for GetGroup operation
 ///</summary>
 public IGetGroupPaginator GetGroup(GetGroupRequest request)
 {
     return(new GetGroupPaginator(this.client, request));
 }
コード例 #6
0
 /// <summary>
 /// <para>Returns a list of Users that are in the specified group. You can
 /// paginate the results using the <c>MaxItems</c> and <c>Marker</c>
 /// parameters.</para>
 /// </summary>
 /// 
 /// <param name="getGroupRequest">Container for the necessary parameters
 ///           to execute the GetGroup service method on
 ///           AmazonIdentityManagementService.</param>
 /// 
 /// <returns>The response from the GetGroup service method, as returned by
 ///         AmazonIdentityManagementService.</returns>
 /// 
 /// <exception cref="NoSuchEntityException"/>
 public GetGroupResponse GetGroup(GetGroupRequest getGroupRequest)
 {
     IRequest<GetGroupRequest> request = new GetGroupRequestMarshaller().Marshall(getGroupRequest);
     GetGroupResponse response = Invoke<GetGroupRequest, GetGroupResponse> (request, this.signer, GetGroupResponseUnmarshaller.GetInstance());
     return response;
 }
コード例 #7
0
 /// <summary>
 /// Initiates the asynchronous execution of the GetGroup operation.
 /// </summary>
 /// 
 /// <param name="request">Container for the necessary parameters to execute the GetGroup operation on AmazonIdentityManagementServiceClient.</param>
 /// <param name="callback">An Action delegate that is invoked when the operation completes.</param>
 /// <param name="options">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 void GetGroupAsync(GetGroupRequest request, AmazonServiceCallback<GetGroupRequest, GetGroupResponse> callback, AsyncOptions options = null)
 {
     options = options == null?new AsyncOptions():options;
     var marshaller = new GetGroupRequestMarshaller();
     var unmarshaller = GetGroupResponseUnmarshaller.Instance;
     Action<AmazonWebServiceRequest, AmazonWebServiceResponse, Exception, AsyncOptions> callbackHelper = null;
     if(callback !=null )
         callbackHelper = (AmazonWebServiceRequest req, AmazonWebServiceResponse res, Exception ex, AsyncOptions ao) => { 
             AmazonServiceResult<GetGroupRequest,GetGroupResponse> responseObject 
                     = new AmazonServiceResult<GetGroupRequest,GetGroupResponse>((GetGroupRequest)req, (GetGroupResponse)res, ex , ao.State);    
                 callback(responseObject); 
         };
     BeginInvoke<GetGroupRequest>(request, marshaller, unmarshaller, options, callbackHelper);
 }
        IAsyncResult invokeGetGroup(GetGroupRequest request, AsyncCallback callback, object state, bool synchronized)
        {
            var marshaller = new GetGroupRequestMarshaller();
            var unmarshaller = GetGroupResponseUnmarshaller.Instance;

            return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer);
        }
コード例 #9
0
        internal GetGroupResponse GetGroup(GetGroupRequest request)
        {
            var marshaller = new GetGroupRequestMarshaller();
            var unmarshaller = GetGroupResponseUnmarshaller.Instance;

            return Invoke<GetGroupRequest,GetGroupResponse>(request, marshaller, unmarshaller);
        }
        public override async Task<Resource[]> Query(
            IQueryParameters parameters, 
            string correlationIdentifier)
        {
            if (null == parameters)
            {
                throw new ArgumentNullException(AmazonWebServicesProvider.ArgumentNameParameters);
            }

            if (string.IsNullOrWhiteSpace(correlationIdentifier))
            {
                throw new ArgumentNullException(AmazonWebServicesProvider.ArgumentNameCorrelationIdentifier);
            }

            if (null == parameters.AlternateFilters)
            {
                throw new ArgumentException(ProvisioningAgentResources.ExceptionInvalidParameters);
            }

            if (string.IsNullOrWhiteSpace(parameters.SchemaIdentifier))
            {
                throw new ArgumentException(ProvisioningAgentResources.ExceptionInvalidParameters);
            }

            string informationAlternateFilterCount = parameters.AlternateFilters.Count.ToString(CultureInfo.InvariantCulture);
            ProvisioningAgentMonitor.Instance.Inform(informationAlternateFilterCount, true, correlationIdentifier);

            if (parameters.AlternateFilters.Count != 1)
            {
                string exceptionMessage =
                    string.Format(
                        CultureInfo.InvariantCulture,
                        ProvisioningAgentResources.ExceptionFilterCountTemplate,
                        1,
                        parameters.AlternateFilters.Count);
                throw new NotSupportedException(exceptionMessage);
            }

            Resource[] results;
            IFilter queryFilter = parameters.AlternateFilters.Single();
            if (queryFilter.AdditionalFilter != null)
            {
                results = await this.QueryReference(parameters, correlationIdentifier);
                return results;
            }

            AmazonWebServicesProvider.Validate(parameters);

            if (string.IsNullOrWhiteSpace(queryFilter.AttributePath))
            {
                throw new ArgumentException(ProvisioningAgentResources.ExceptionInvalidParameters);
            }

            if (string.IsNullOrWhiteSpace(queryFilter.ComparisonValue))
            {
                throw new ArgumentException(ProvisioningAgentResources.ExceptionInvalidParameters);
            }

            if (!string.Equals(queryFilter.AttributePath, AttributeNames.ExternalIdentifier, StringComparison.Ordinal))
            {
                throw new NotSupportedException(queryFilter.AttributePath);
            }

            IAmazonIdentityManagementService proxy = null;
            try
            {
                proxy = AWSClientFactory.CreateAmazonIdentityManagementServiceClient(this.credentials);            

                switch (parameters.SchemaIdentifier)
                {
                    case SchemaIdentifiers.Core2EnterpriseUser:
                        GetUserRequest getRequestUser =
                            new GetUserRequest()
                                {
                                    UserName = queryFilter.ComparisonValue
                                };
                        GetUserResult responseUser = await proxy.GetUserAsync(getRequestUser);
                        if (null == responseUser.User)
                        {
                            return new Resource[0];
                        }

                        Core2EnterpriseUser resourceUser =
                            new Core2EnterpriseUser()
                            {
                                Identifier = responseUser.User.UserId,
                                ExternalIdentifier = responseUser.User.UserName
                            };
                        Resource[] resourceUsers =
                            new Resource[]
                            {
                                resourceUser
                            };
                        return resourceUsers;

                    case SchemaIdentifiers.WindowsAzureActiveDirectoryGroup:
                        GetGroupRequest getRequestGroup =
                            new GetGroupRequest()
                                {
                                    GroupName = queryFilter.ComparisonValue
                                };
                        GetGroupResult responseGroup = await proxy.GetGroupAsync(getRequestGroup);
                        if (null == responseGroup.Group)
                        {
                            return new Resource[0];
                        }

                        WindowsAzureActiveDirectoryGroup resourceGroup =
                            new WindowsAzureActiveDirectoryGroup()
                            {
                                Identifier = responseGroup.Group.GroupId,
                                ExternalIdentifier = responseGroup.Group.GroupName
                            };
                        Resource[] resourceGroups =
                            new Resource[]
                            {
                                resourceGroup
                            };
                        return resourceGroups;

                    default:
                        throw new NotSupportedException(parameters.SchemaIdentifier);
                }
            }
            finally
            {
                if (proxy != null)
                {
                    proxy.Dispose();
                    proxy = null;
                }
            }
        }
コード例 #11
0
        /// <summary>
        /// <para>Returns a list of users that are in the specified group. You can paginate the results using the <c>MaxItems</c> and <c>Marker</c>
        /// parameters.</para>
        /// </summary>
        /// 
        /// <param name="getGroupRequest">Container for the necessary parameters to execute the GetGroup service method on
        /// AmazonIdentityManagementService.</param>
        /// 
        /// <returns>The response from the GetGroup service method, as returned by AmazonIdentityManagementService.</returns>
        /// 
        /// <exception cref="T:Amazon.IdentityManagement.Model.NoSuchEntityException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
		public Task<GetGroupResponse> GetGroupAsync(GetGroupRequest getGroupRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new GetGroupRequestMarshaller();
            var unmarshaller = GetGroupResponseUnmarshaller.GetInstance();
            return Invoke<IRequest, GetGroupRequest, GetGroupResponse>(getGroupRequest, marshaller, unmarshaller, signer, cancellationToken);
        }
コード例 #12
0
		internal GetGroupResponse GetGroup(GetGroupRequest request)
        {
            var task = GetGroupAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return null;
            }
        }
コード例 #13
0
 private Amazon.IdentityManagement.Model.GetGroupResponse CallAWSServiceOperation(IAmazonIdentityManagementService client, Amazon.IdentityManagement.Model.GetGroupRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Identity and Access Management", "GetGroup");
     try
     {
         #if DESKTOP
         return(client.GetGroup(request));
         #elif CORECLR
         return(client.GetGroupAsync(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;
     }
 }
コード例 #14
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;

            #pragma warning disable CS0618, CS0612 //A class member was marked with the Obsolete attribute
            var useParameterSelect = this.Select.StartsWith("^") || this.PassThru.IsPresent;
            #pragma warning restore CS0618, CS0612 //A class member was marked with the Obsolete attribute

            // create request and set iteration invariants
            var request = new Amazon.IdentityManagement.Model.GetGroupRequest();

            if (cmdletContext.GroupName != null)
            {
                request.GroupName = cmdletContext.GroupName;
            }
            if (cmdletContext.MaxItem != null)
            {
                request.MaxItems = cmdletContext.MaxItem.Value;
            }

            // Initialize loop variant and commence piping
            var _nextToken             = cmdletContext.Marker;
            var _userControllingPaging = this.NoAutoIteration.IsPresent || ParameterWasBound(nameof(this.Marker));

            var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint);
            do
            {
                request.Marker = _nextToken;

                CmdletOutput output;

                try
                {
                    var response = CallAWSServiceOperation(client, request);

                    object pipelineOutput = null;
                    if (!useParameterSelect)
                    {
                        pipelineOutput = cmdletContext.Select(response, this);
                    }
                    output = new CmdletOutput
                    {
                        PipelineOutput  = pipelineOutput,
                        ServiceResponse = response
                    };

                    _nextToken = response.Marker;
                }
                catch (Exception e)
                {
                    output = new CmdletOutput {
                        ErrorResponse = e
                    };
                }

                ProcessOutput(output);
            } while (!_userControllingPaging && AutoIterationHelpers.HasValue(_nextToken));

            if (useParameterSelect)
            {
                WriteObject(cmdletContext.Select(null, this));
            }


            return(null);
        }
コード例 #15
0
 internal GetGroupPaginator(IAmazonIdentityManagementService client, GetGroupRequest request)
 {
     this._client  = client;
     this._request = request;
 }
 IAsyncResult invokeGetGroup(GetGroupRequest getGroupRequest, AsyncCallback callback, object state, bool synchronized)
 {
     IRequest irequest = new GetGroupRequestMarshaller().Marshall(getGroupRequest);
     var unmarshaller = GetGroupResponseUnmarshaller.GetInstance();
     AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);
     Invoke(result);
     return result;
 }
 /// <summary>
 /// Initiates the asynchronous execution of the GetGroup operation.
 /// <seealso cref="Amazon.IdentityManagement.AmazonIdentityManagementService.GetGroup"/>
 /// </summary>
 /// 
 /// <param name="getGroupRequest">Container for the necessary parameters to execute the GetGroup operation on
 ///          AmazonIdentityManagementService.</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 EndGetGroup
 ///         operation.</returns>
 public IAsyncResult BeginGetGroup(GetGroupRequest getGroupRequest, AsyncCallback callback, object state)
 {
     return invokeGetGroup(getGroupRequest, callback, state, false);
 }
コード例 #18
0
        /// <summary>
        /// <para>Returns a list of users that are in the specified group. You can paginate the results using the <c>MaxItems</c> and <c>Marker</c>
        /// parameters.</para>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the GetGroup service method on
        /// AmazonIdentityManagementService.</param>
        /// 
        /// <returns>The response from the GetGroup service method, as returned by AmazonIdentityManagementService.</returns>
        /// 
        /// <exception cref="T:Amazon.IdentityManagement.Model.NoSuchEntityException" />
		public GetGroupResponse GetGroup(GetGroupRequest request)
        {
            var task = GetGroupAsync(request);
            try
            {
                return task.Result;
            }
            catch(AggregateException e)
            {
                throw e.InnerException;
            }
        }
コード例 #19
0
        /// <summary>
        /// Initiates the asynchronous execution of the GetGroup operation.
        /// <seealso cref="Amazon.IdentityManagement.IAmazonIdentityManagementService"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the GetGroup 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<GetGroupResponse> GetGroupAsync(GetGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new GetGroupRequestMarshaller();
            var unmarshaller = GetGroupResponseUnmarshaller.Instance;

            return InvokeAsync<GetGroupRequest,GetGroupResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }
コード例 #20
0
        /// <summary>
        /// Initiates the asynchronous execution of the GetGroup operation.
        /// <seealso cref="Amazon.IdentityManagement.IAmazonIdentityManagementService.GetGroup"/>
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the GetGroup 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<GetGroupResponse> GetGroupAsync(GetGroupRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new GetGroupRequestMarshaller();
            var unmarshaller = GetGroupResponseUnmarshaller.GetInstance();
            var response = await Invoke<IRequest, GetGroupRequest, GetGroupResponse>(request, marshaller, unmarshaller, signer, cancellationToken)
                .ConfigureAwait(continueOnCapturedContext: false);
            return response;
        }