public override void Invoke(AWSCredentials creds, RegionEndpoint region, int maxItems)
        {
            AmazonManagedBlockchainConfig config = new AmazonManagedBlockchainConfig();

            config.RegionEndpoint = region;
            ConfigureClient(config);
            AmazonManagedBlockchainClient client = new AmazonManagedBlockchainClient(creds, config);

            ListInvitationsResponse resp = new ListInvitationsResponse();

            do
            {
                ListInvitationsRequest req = new ListInvitationsRequest
                {
                    NextToken = resp.NextToken
                    ,
                    MaxResults = maxItems
                };

                resp = client.ListInvitations(req);
                CheckError(resp.HttpStatusCode, "200");

                foreach (var obj in resp.Invitations)
                {
                    AddObject(obj);
                }
            }while (!string.IsNullOrEmpty(resp.NextToken));
        }
        /// <summary>
        /// Retrieves the list of open and accepted behavior graph invitations for the member
        /// account. This operation can only be called by a member account.
        ///
        ///
        /// <para>
        /// Open invitations are invitations that the member account has not responded to.
        /// </para>
        ///
        /// <para>
        /// The results do not include behavior graphs for which the member account declined the
        /// invitation. The results also do not include behavior graphs that the member account
        /// resigned from or was removed from.
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the ListInvitations service method.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        ///
        /// <returns>The response from the ListInvitations service method, as returned by Detective.</returns>
        /// <exception cref="Amazon.Detective.Model.InternalServerException">
        /// The request was valid but failed because of a problem with the service.
        /// </exception>
        /// <exception cref="Amazon.Detective.Model.ValidationException">
        /// The request parameters are invalid.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/detective-2018-10-26/ListInvitations">REST API Reference for ListInvitations Operation</seealso>
        public virtual Task <ListInvitationsResponse> ListInvitationsAsync(ListInvitationsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListInvitationsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListInvitationsResponseUnmarshaller.Instance;

            return(InvokeAsync <ListInvitationsResponse>(request, options, cancellationToken));
        }
        internal virtual ListInvitationsResponse ListInvitations(ListInvitationsRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = ListInvitationsRequestMarshaller.Instance;
            options.ResponseUnmarshaller = ListInvitationsResponseUnmarshaller.Instance;

            return(Invoke <ListInvitationsResponse>(request, options));
        }
Exemplo n.º 4
0
        public async Task <ListResponse <InvitationsListItemDto> > ListAsync(ListInvitationsRequest request)
        {
            var filter = _mapper.Map <ListInvitationsRequest, InvitationsFilter>(request);
            var paging = _mapper.Map <ListInvitationsRequest, Paging>(request);

            var invitations = await _invitationRepository.GetListAsync(filter, null, paging);

            var invitationsCount = await _invitationRepository.CountAsync(filter);

            var invitationsDtosList = _mapper.Map <List <Invitation>, List <InvitationsListItemDto> >(invitations);

            return(new ListResponse <InvitationsListItemDto>(invitationsDtosList, invitationsCount));
        }
        public async Task <IActionResult> List([FromQuery] ListInvitationsRequest request)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState.GetErrorMessages()));
            }

            var response = await _invitationService.ListAsync(request);

            if (!response.IsValid)
            {
                return(BadRequest(response.Message));
            }
            return(Ok(response));
        }