/// <summary>
        /// Initiates the asynchronous execution of the UpdateRadius operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the UpdateRadius operation on AmazonDirectoryServiceClient.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
        ///          procedure using the AsyncState property.</param>
        /// 
        /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndUpdateRadius
        ///         operation.</returns>
        public IAsyncResult BeginUpdateRadius(UpdateRadiusRequest request, AsyncCallback callback, object state)
        {
            var marshaller = new UpdateRadiusRequestMarshaller();
            var unmarshaller = UpdateRadiusResponseUnmarshaller.Instance;

            return BeginInvoke<UpdateRadiusRequest>(request, marshaller, unmarshaller,
                callback, state);
        }
        /// <summary>
        /// Updates the Remote Authentication Dial In User Service (RADIUS) server information
        /// for an AD Connector directory.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the UpdateRadius service method.</param>
        /// 
        /// <returns>The response from the UpdateRadius service method, as returned by DirectoryService.</returns>
        /// <exception cref="Amazon.DirectoryService.Model.ClientException">
        /// A client exception has occurred.
        /// </exception>
        /// <exception cref="Amazon.DirectoryService.Model.EntityDoesNotExistException">
        /// The specified entity could not be found.
        /// </exception>
        /// <exception cref="Amazon.DirectoryService.Model.InvalidParameterException">
        /// One or more parameters are not valid.
        /// </exception>
        /// <exception cref="Amazon.DirectoryService.Model.ServiceException">
        /// An exception has occurred in AWS Directory Service.
        /// </exception>
        public UpdateRadiusResponse UpdateRadius(UpdateRadiusRequest request)
        {
            var marshaller = new UpdateRadiusRequestMarshaller();
            var unmarshaller = UpdateRadiusResponseUnmarshaller.Instance;

            return Invoke<UpdateRadiusRequest,UpdateRadiusResponse>(request, marshaller, unmarshaller);
        }
Esempio n. 3
0
        public object Execute(ExecutorContext context)
        {
            var cmdletContext = context as CmdletContext;
            // create request
            var request = new Amazon.DirectoryService.Model.UpdateRadiusRequest();

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

            // populate RadiusSettings
            var requestRadiusSettingsIsNull = true;

            request.RadiusSettings = new Amazon.DirectoryService.Model.RadiusSettings();
            Amazon.DirectoryService.RadiusAuthenticationProtocol requestRadiusSettings_radiusSettings_AuthenticationProtocol = null;
            if (cmdletContext.RadiusSettings_AuthenticationProtocol != null)
            {
                requestRadiusSettings_radiusSettings_AuthenticationProtocol = cmdletContext.RadiusSettings_AuthenticationProtocol;
            }
            if (requestRadiusSettings_radiusSettings_AuthenticationProtocol != null)
            {
                request.RadiusSettings.AuthenticationProtocol = requestRadiusSettings_radiusSettings_AuthenticationProtocol;
                requestRadiusSettingsIsNull = false;
            }
            System.String requestRadiusSettings_radiusSettings_DisplayLabel = null;
            if (cmdletContext.RadiusSettings_DisplayLabel != null)
            {
                requestRadiusSettings_radiusSettings_DisplayLabel = cmdletContext.RadiusSettings_DisplayLabel;
            }
            if (requestRadiusSettings_radiusSettings_DisplayLabel != null)
            {
                request.RadiusSettings.DisplayLabel = requestRadiusSettings_radiusSettings_DisplayLabel;
                requestRadiusSettingsIsNull         = false;
            }
            System.Int32?requestRadiusSettings_radiusSettings_RadiusPort = null;
            if (cmdletContext.RadiusSettings_RadiusPort != null)
            {
                requestRadiusSettings_radiusSettings_RadiusPort = cmdletContext.RadiusSettings_RadiusPort.Value;
            }
            if (requestRadiusSettings_radiusSettings_RadiusPort != null)
            {
                request.RadiusSettings.RadiusPort = requestRadiusSettings_radiusSettings_RadiusPort.Value;
                requestRadiusSettingsIsNull       = false;
            }
            System.Int32?requestRadiusSettings_radiusSettings_RadiusRetry = null;
            if (cmdletContext.RadiusSettings_RadiusRetry != null)
            {
                requestRadiusSettings_radiusSettings_RadiusRetry = cmdletContext.RadiusSettings_RadiusRetry.Value;
            }
            if (requestRadiusSettings_radiusSettings_RadiusRetry != null)
            {
                request.RadiusSettings.RadiusRetries = requestRadiusSettings_radiusSettings_RadiusRetry.Value;
                requestRadiusSettingsIsNull          = false;
            }
            List <System.String> requestRadiusSettings_radiusSettings_RadiusServer = null;

            if (cmdletContext.RadiusSettings_RadiusServer != null)
            {
                requestRadiusSettings_radiusSettings_RadiusServer = cmdletContext.RadiusSettings_RadiusServer;
            }
            if (requestRadiusSettings_radiusSettings_RadiusServer != null)
            {
                request.RadiusSettings.RadiusServers = requestRadiusSettings_radiusSettings_RadiusServer;
                requestRadiusSettingsIsNull          = false;
            }
            System.Int32?requestRadiusSettings_radiusSettings_RadiusTimeout = null;
            if (cmdletContext.RadiusSettings_RadiusTimeout != null)
            {
                requestRadiusSettings_radiusSettings_RadiusTimeout = cmdletContext.RadiusSettings_RadiusTimeout.Value;
            }
            if (requestRadiusSettings_radiusSettings_RadiusTimeout != null)
            {
                request.RadiusSettings.RadiusTimeout = requestRadiusSettings_radiusSettings_RadiusTimeout.Value;
                requestRadiusSettingsIsNull          = false;
            }
            System.String requestRadiusSettings_radiusSettings_SharedSecret = null;
            if (cmdletContext.RadiusSettings_SharedSecret != null)
            {
                requestRadiusSettings_radiusSettings_SharedSecret = cmdletContext.RadiusSettings_SharedSecret;
            }
            if (requestRadiusSettings_radiusSettings_SharedSecret != null)
            {
                request.RadiusSettings.SharedSecret = requestRadiusSettings_radiusSettings_SharedSecret;
                requestRadiusSettingsIsNull         = false;
            }
            System.Boolean?requestRadiusSettings_radiusSettings_UseSameUsername = null;
            if (cmdletContext.RadiusSettings_UseSameUsername != null)
            {
                requestRadiusSettings_radiusSettings_UseSameUsername = cmdletContext.RadiusSettings_UseSameUsername.Value;
            }
            if (requestRadiusSettings_radiusSettings_UseSameUsername != null)
            {
                request.RadiusSettings.UseSameUsername = requestRadiusSettings_radiusSettings_UseSameUsername.Value;
                requestRadiusSettingsIsNull            = false;
            }
            // determine if request.RadiusSettings should be set to null
            if (requestRadiusSettingsIsNull)
            {
                request.RadiusSettings = 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);
        }
Esempio n. 4
0
 private Amazon.DirectoryService.Model.UpdateRadiusResponse CallAWSServiceOperation(IAmazonDirectoryService client, Amazon.DirectoryService.Model.UpdateRadiusRequest request)
 {
     Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Directory Service", "UpdateRadius");
     try
     {
         #if DESKTOP
         return(client.UpdateRadius(request));
         #elif CORECLR
         return(client.UpdateRadiusAsync(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;
     }
 }
        /// <summary>
        /// Initiates the asynchronous execution of the UpdateRadius operation.
        /// </summary>
        /// 
        /// <param name="request">Container for the necessary parameters to execute the UpdateRadius operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public Task<UpdateRadiusResponse> UpdateRadiusAsync(UpdateRadiusRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller = new UpdateRadiusRequestMarshaller();
            var unmarshaller = UpdateRadiusResponseUnmarshaller.Instance;

            return InvokeAsync<UpdateRadiusRequest,UpdateRadiusResponse>(request, marshaller, 
                unmarshaller, cancellationToken);
        }