aws-ec2-transitgatewaymulticastgroupmember/src/main/java/software/amazon/ec2/transitgatewaymulticastgroupmember/workflow/read/Read.java [59:106]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        return SearchTransitGatewayMulticastGroupsRequest.builder()
            .transitGatewayMulticastDomainId(model.getTransitGatewayMulticastDomainId())
            .filters(filters)
            .build();
    }

    private SearchTransitGatewayMulticastGroupsResponse makeServiceCall(SearchTransitGatewayMulticastGroupsRequest awsRequest, ProxyClient<Ec2Client> client) {
        return this.proxy.injectCredentialsAndInvokeV2(awsRequest, client.client()::searchTransitGatewayMulticastGroups);
    }

    private ResourceModel translateResponsesToModel(SearchTransitGatewayMulticastGroupsResponse awsResponse, ResourceModel model) {
        if(awsResponse.multicastGroups().isEmpty()) {
            return null;
        } else {
            TransitGatewayMulticastGroup response = awsResponse.multicastGroups().get(0);
            return ResourceModel.builder()
                .transitGatewayMulticastDomainId(model.getTransitGatewayMulticastDomainId())
                .transitGatewayAttachmentId(response.transitGatewayAttachmentId())
                .groupIpAddress(response.groupIpAddress())
                .groupMember(response.groupMember())
                .subnetId(response.subnetId())
                .groupSource(response.groupSource())
                .groupIpAddress(response.groupIpAddress())
                .networkInterfaceId(response.networkInterfaceId())
                .memberType(response.memberTypeAsString())
                .resourceId(response.resourceId())
                .resourceType(response.resourceTypeAsString())
                .sourceType(response.sourceTypeAsString())
                .build();
        }
    }

    private ProgressEvent<ResourceModel, CallbackContext>  handleError(SearchTransitGatewayMulticastGroupsRequest awsRequest, Exception exception, ProxyClient<Ec2Client> client, ResourceModel model, CallbackContext context) {
        if(exception instanceof ArrayIndexOutOfBoundsException) {
            AwsServiceException emptyResponseException = AwsServiceException.builder().awsErrorDetails(AwsErrorDetails.builder().errorCode("NotFound").errorMessage("Not Found").build()).build();
            return ProgressEvent.defaultFailureHandler(emptyResponseException, HandlerErrorCode.NotFound);
        } else {
            return ProgressEvent.defaultFailureHandler(exception, ExceptionMapper.mapToHandlerErrorCode(exception));
        }
    }

    private  ProgressEvent<ResourceModel, CallbackContext> done(SearchTransitGatewayMulticastGroupsResponse response) {
        ResourceModel model = this.translateResponsesToModel(response, this.progress.getResourceModel());
        if(model == null) {
            AwsServiceException emptyResponseException = AwsServiceException.builder().awsErrorDetails(AwsErrorDetails.builder().errorCode("NotFound").errorMessage("Not Found").build()).build();
            return ProgressEvent.defaultFailureHandler(emptyResponseException, HandlerErrorCode.NotFound);
        } else {
            return ProgressEvent.defaultSuccessHandler(this.translateResponsesToModel(response, this.progress.getResourceModel()));
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



aws-ec2-transitgatewaymulticastgroupsource/src/main/java/software/amazon/ec2/transitgatewaymulticastgroupsource/workflow/read/Read.java [59:106]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        return SearchTransitGatewayMulticastGroupsRequest.builder()
            .transitGatewayMulticastDomainId(model.getTransitGatewayMulticastDomainId())
            .filters(filters)
            .build();
    }

    private SearchTransitGatewayMulticastGroupsResponse makeServiceCall(SearchTransitGatewayMulticastGroupsRequest awsRequest, ProxyClient<Ec2Client> client) {
        return this.proxy.injectCredentialsAndInvokeV2(awsRequest, client.client()::searchTransitGatewayMulticastGroups);
    }

    private ResourceModel translateResponsesToModel(SearchTransitGatewayMulticastGroupsResponse awsResponse, ResourceModel model) {
        if(awsResponse.multicastGroups().isEmpty()) {
            return null;
        } else {
            TransitGatewayMulticastGroup response = awsResponse.multicastGroups().get(0);
            return ResourceModel.builder()
                .transitGatewayMulticastDomainId(model.getTransitGatewayMulticastDomainId())
                .transitGatewayAttachmentId(response.transitGatewayAttachmentId())
                .groupIpAddress(response.groupIpAddress())
                .groupMember(response.groupMember())
                .subnetId(response.subnetId())
                .groupSource(response.groupSource())
                .groupIpAddress(response.groupIpAddress())
                .networkInterfaceId(response.networkInterfaceId())
                .memberType(response.memberTypeAsString())
                .resourceId(response.resourceId())
                .resourceType(response.resourceTypeAsString())
                .sourceType(response.sourceTypeAsString())
                .build();
        }
    }

    private ProgressEvent<ResourceModel, CallbackContext>  handleError(SearchTransitGatewayMulticastGroupsRequest awsRequest, Exception exception, ProxyClient<Ec2Client> client, ResourceModel model, CallbackContext context) {
        if(exception instanceof ArrayIndexOutOfBoundsException) {
            AwsServiceException emptyResponseException = AwsServiceException.builder().awsErrorDetails(AwsErrorDetails.builder().errorCode("NotFound").errorMessage("Not Found").build()).build();
            return ProgressEvent.defaultFailureHandler(emptyResponseException, HandlerErrorCode.NotFound);
        } else {
            return ProgressEvent.defaultFailureHandler(exception, ExceptionMapper.mapToHandlerErrorCode(exception));
        }
    }

    private  ProgressEvent<ResourceModel, CallbackContext> done(SearchTransitGatewayMulticastGroupsResponse response) {
        ResourceModel model = this.translateResponsesToModel(response, this.progress.getResourceModel());
        if(model == null) {
            AwsServiceException emptyResponseException = AwsServiceException.builder().awsErrorDetails(AwsErrorDetails.builder().errorCode("NotFound").errorMessage("Not Found").build()).build();
            return ProgressEvent.defaultFailureHandler(emptyResponseException, HandlerErrorCode.NotFound);
        } else {
            return ProgressEvent.defaultSuccessHandler(this.translateResponsesToModel(response, this.progress.getResourceModel()));
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



