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

            if (cmdletContext.AttributeUpdate != null)
            {
                request.AttributeUpdates = cmdletContext.AttributeUpdate;
            }
            if (cmdletContext.DirectoryArn != null)
            {
                request.DirectoryArn = cmdletContext.DirectoryArn;
            }

            // populate TypedLinkSpecifier
            var requestTypedLinkSpecifierIsNull = true;

            request.TypedLinkSpecifier = new Amazon.CloudDirectory.Model.TypedLinkSpecifier();
            List <Amazon.CloudDirectory.Model.AttributeNameAndValue> requestTypedLinkSpecifier_typedLinkSpecifier_IdentityAttributeValue = null;

            if (cmdletContext.TypedLinkSpecifier_IdentityAttributeValue != null)
            {
                requestTypedLinkSpecifier_typedLinkSpecifier_IdentityAttributeValue = cmdletContext.TypedLinkSpecifier_IdentityAttributeValue;
            }
            if (requestTypedLinkSpecifier_typedLinkSpecifier_IdentityAttributeValue != null)
            {
                request.TypedLinkSpecifier.IdentityAttributeValues = requestTypedLinkSpecifier_typedLinkSpecifier_IdentityAttributeValue;
                requestTypedLinkSpecifierIsNull = false;
            }
            Amazon.CloudDirectory.Model.ObjectReference requestTypedLinkSpecifier_typedLinkSpecifier_SourceObjectReference = null;

            // populate SourceObjectReference
            var requestTypedLinkSpecifier_typedLinkSpecifier_SourceObjectReferenceIsNull = true;

            requestTypedLinkSpecifier_typedLinkSpecifier_SourceObjectReference = new Amazon.CloudDirectory.Model.ObjectReference();
            System.String requestTypedLinkSpecifier_typedLinkSpecifier_SourceObjectReference_sourceObjectReference_Selector = null;
            if (cmdletContext.SourceObjectReference_Selector != null)
            {
                requestTypedLinkSpecifier_typedLinkSpecifier_SourceObjectReference_sourceObjectReference_Selector = cmdletContext.SourceObjectReference_Selector;
            }
            if (requestTypedLinkSpecifier_typedLinkSpecifier_SourceObjectReference_sourceObjectReference_Selector != null)
            {
                requestTypedLinkSpecifier_typedLinkSpecifier_SourceObjectReference.Selector = requestTypedLinkSpecifier_typedLinkSpecifier_SourceObjectReference_sourceObjectReference_Selector;
                requestTypedLinkSpecifier_typedLinkSpecifier_SourceObjectReferenceIsNull    = false;
            }
            // determine if requestTypedLinkSpecifier_typedLinkSpecifier_SourceObjectReference should be set to null
            if (requestTypedLinkSpecifier_typedLinkSpecifier_SourceObjectReferenceIsNull)
            {
                requestTypedLinkSpecifier_typedLinkSpecifier_SourceObjectReference = null;
            }
            if (requestTypedLinkSpecifier_typedLinkSpecifier_SourceObjectReference != null)
            {
                request.TypedLinkSpecifier.SourceObjectReference = requestTypedLinkSpecifier_typedLinkSpecifier_SourceObjectReference;
                requestTypedLinkSpecifierIsNull = false;
            }
            Amazon.CloudDirectory.Model.ObjectReference requestTypedLinkSpecifier_typedLinkSpecifier_TargetObjectReference = null;

            // populate TargetObjectReference
            var requestTypedLinkSpecifier_typedLinkSpecifier_TargetObjectReferenceIsNull = true;

            requestTypedLinkSpecifier_typedLinkSpecifier_TargetObjectReference = new Amazon.CloudDirectory.Model.ObjectReference();
            System.String requestTypedLinkSpecifier_typedLinkSpecifier_TargetObjectReference_targetObjectReference_Selector = null;
            if (cmdletContext.TargetObjectReference_Selector != null)
            {
                requestTypedLinkSpecifier_typedLinkSpecifier_TargetObjectReference_targetObjectReference_Selector = cmdletContext.TargetObjectReference_Selector;
            }
            if (requestTypedLinkSpecifier_typedLinkSpecifier_TargetObjectReference_targetObjectReference_Selector != null)
            {
                requestTypedLinkSpecifier_typedLinkSpecifier_TargetObjectReference.Selector = requestTypedLinkSpecifier_typedLinkSpecifier_TargetObjectReference_targetObjectReference_Selector;
                requestTypedLinkSpecifier_typedLinkSpecifier_TargetObjectReferenceIsNull    = false;
            }
            // determine if requestTypedLinkSpecifier_typedLinkSpecifier_TargetObjectReference should be set to null
            if (requestTypedLinkSpecifier_typedLinkSpecifier_TargetObjectReferenceIsNull)
            {
                requestTypedLinkSpecifier_typedLinkSpecifier_TargetObjectReference = null;
            }
            if (requestTypedLinkSpecifier_typedLinkSpecifier_TargetObjectReference != null)
            {
                request.TypedLinkSpecifier.TargetObjectReference = requestTypedLinkSpecifier_typedLinkSpecifier_TargetObjectReference;
                requestTypedLinkSpecifierIsNull = false;
            }
            Amazon.CloudDirectory.Model.TypedLinkSchemaAndFacetName requestTypedLinkSpecifier_typedLinkSpecifier_TypedLinkFacet = null;

            // populate TypedLinkFacet
            var requestTypedLinkSpecifier_typedLinkSpecifier_TypedLinkFacetIsNull = true;

            requestTypedLinkSpecifier_typedLinkSpecifier_TypedLinkFacet = new Amazon.CloudDirectory.Model.TypedLinkSchemaAndFacetName();
            System.String requestTypedLinkSpecifier_typedLinkSpecifier_TypedLinkFacet_typedLinkFacet_SchemaArn = null;
            if (cmdletContext.TypedLinkFacet_SchemaArn != null)
            {
                requestTypedLinkSpecifier_typedLinkSpecifier_TypedLinkFacet_typedLinkFacet_SchemaArn = cmdletContext.TypedLinkFacet_SchemaArn;
            }
            if (requestTypedLinkSpecifier_typedLinkSpecifier_TypedLinkFacet_typedLinkFacet_SchemaArn != null)
            {
                requestTypedLinkSpecifier_typedLinkSpecifier_TypedLinkFacet.SchemaArn = requestTypedLinkSpecifier_typedLinkSpecifier_TypedLinkFacet_typedLinkFacet_SchemaArn;
                requestTypedLinkSpecifier_typedLinkSpecifier_TypedLinkFacetIsNull     = false;
            }
            System.String requestTypedLinkSpecifier_typedLinkSpecifier_TypedLinkFacet_typedLinkFacet_TypedLinkName = null;
            if (cmdletContext.TypedLinkFacet_TypedLinkName != null)
            {
                requestTypedLinkSpecifier_typedLinkSpecifier_TypedLinkFacet_typedLinkFacet_TypedLinkName = cmdletContext.TypedLinkFacet_TypedLinkName;
            }
            if (requestTypedLinkSpecifier_typedLinkSpecifier_TypedLinkFacet_typedLinkFacet_TypedLinkName != null)
            {
                requestTypedLinkSpecifier_typedLinkSpecifier_TypedLinkFacet.TypedLinkName = requestTypedLinkSpecifier_typedLinkSpecifier_TypedLinkFacet_typedLinkFacet_TypedLinkName;
                requestTypedLinkSpecifier_typedLinkSpecifier_TypedLinkFacetIsNull         = false;
            }
            // determine if requestTypedLinkSpecifier_typedLinkSpecifier_TypedLinkFacet should be set to null
            if (requestTypedLinkSpecifier_typedLinkSpecifier_TypedLinkFacetIsNull)
            {
                requestTypedLinkSpecifier_typedLinkSpecifier_TypedLinkFacet = null;
            }
            if (requestTypedLinkSpecifier_typedLinkSpecifier_TypedLinkFacet != null)
            {
                request.TypedLinkSpecifier.TypedLinkFacet = requestTypedLinkSpecifier_typedLinkSpecifier_TypedLinkFacet;
                requestTypedLinkSpecifierIsNull           = false;
            }
            // determine if request.TypedLinkSpecifier should be set to null
            if (requestTypedLinkSpecifierIsNull)
            {
                request.TypedLinkSpecifier = null;
            }

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