Example #1
0
 private Amazon.SageMaker.Model.GetSearchSuggestionsResponse CallAWSServiceOperation(IAmazonSageMaker client, Amazon.SageMaker.Model.GetSearchSuggestionsRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon SageMaker Service", "GetSearchSuggestions");
     try
     {
         #if DESKTOP
         return(client.GetSearchSuggestions(request));
         #elif CORECLR
         return(client.GetSearchSuggestionsAsync(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.SageMaker.Model.GetSearchSuggestionsRequest();

            if (cmdletContext.Resource != null)
            {
                request.Resource = cmdletContext.Resource;
            }

            // populate SuggestionQuery
            var requestSuggestionQueryIsNull = true;

            request.SuggestionQuery = new Amazon.SageMaker.Model.SuggestionQuery();
            Amazon.SageMaker.Model.PropertyNameQuery requestSuggestionQuery_suggestionQuery_PropertyNameQuery = null;

            // populate PropertyNameQuery
            var requestSuggestionQuery_suggestionQuery_PropertyNameQueryIsNull = true;

            requestSuggestionQuery_suggestionQuery_PropertyNameQuery = new Amazon.SageMaker.Model.PropertyNameQuery();
            System.String requestSuggestionQuery_suggestionQuery_PropertyNameQuery_propertyNameQuery_PropertyNameHint = null;
            if (cmdletContext.PropertyNameQuery_PropertyNameHint != null)
            {
                requestSuggestionQuery_suggestionQuery_PropertyNameQuery_propertyNameQuery_PropertyNameHint = cmdletContext.PropertyNameQuery_PropertyNameHint;
            }
            if (requestSuggestionQuery_suggestionQuery_PropertyNameQuery_propertyNameQuery_PropertyNameHint != null)
            {
                requestSuggestionQuery_suggestionQuery_PropertyNameQuery.PropertyNameHint = requestSuggestionQuery_suggestionQuery_PropertyNameQuery_propertyNameQuery_PropertyNameHint;
                requestSuggestionQuery_suggestionQuery_PropertyNameQueryIsNull            = false;
            }
            // determine if requestSuggestionQuery_suggestionQuery_PropertyNameQuery should be set to null
            if (requestSuggestionQuery_suggestionQuery_PropertyNameQueryIsNull)
            {
                requestSuggestionQuery_suggestionQuery_PropertyNameQuery = null;
            }
            if (requestSuggestionQuery_suggestionQuery_PropertyNameQuery != null)
            {
                request.SuggestionQuery.PropertyNameQuery = requestSuggestionQuery_suggestionQuery_PropertyNameQuery;
                requestSuggestionQueryIsNull = false;
            }
            // determine if request.SuggestionQuery should be set to null
            if (requestSuggestionQueryIsNull)
            {
                request.SuggestionQuery = 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);
        }