Example #1
0
 private Amazon.CloudDirectory.Model.CreateTypedLinkFacetResponse CallAWSServiceOperation(IAmazonCloudDirectory client, Amazon.CloudDirectory.Model.CreateTypedLinkFacetRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Cloud Directory", "CreateTypedLinkFacet");
     try
     {
         #if DESKTOP
         return(client.CreateTypedLinkFacet(request));
         #elif CORECLR
         return(client.CreateTypedLinkFacetAsync(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;
     }
 }
Example #2
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.CloudDirectory.Model.CreateTypedLinkFacetRequest();


            // populate Facet
            var requestFacetIsNull = true;

            request.Facet = new Amazon.CloudDirectory.Model.TypedLinkFacet();
            List <Amazon.CloudDirectory.Model.TypedLinkAttributeDefinition> requestFacet_facet_Attribute = null;

            if (cmdletContext.Facet_Attribute != null)
            {
                requestFacet_facet_Attribute = cmdletContext.Facet_Attribute;
            }
            if (requestFacet_facet_Attribute != null)
            {
                request.Facet.Attributes = requestFacet_facet_Attribute;
                requestFacetIsNull       = false;
            }
            List <System.String> requestFacet_facet_IdentityAttributeOrder = null;

            if (cmdletContext.Facet_IdentityAttributeOrder != null)
            {
                requestFacet_facet_IdentityAttributeOrder = cmdletContext.Facet_IdentityAttributeOrder;
            }
            if (requestFacet_facet_IdentityAttributeOrder != null)
            {
                request.Facet.IdentityAttributeOrder = requestFacet_facet_IdentityAttributeOrder;
                requestFacetIsNull = false;
            }
            System.String requestFacet_facet_Name = null;
            if (cmdletContext.Facet_Name != null)
            {
                requestFacet_facet_Name = cmdletContext.Facet_Name;
            }
            if (requestFacet_facet_Name != null)
            {
                request.Facet.Name = requestFacet_facet_Name;
                requestFacetIsNull = false;
            }
            // determine if request.Facet should be set to null
            if (requestFacetIsNull)
            {
                request.Facet = null;
            }
            if (cmdletContext.SchemaArn != null)
            {
                request.SchemaArn = cmdletContext.SchemaArn;
            }

            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);
        }