public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.StorageGateway.Model.UpdateSMBFileShareRequest(); if (cmdletContext.AdminUserList != null) { request.AdminUserList = cmdletContext.AdminUserList; } if (cmdletContext.AuditDestinationARN != null) { request.AuditDestinationARN = cmdletContext.AuditDestinationARN; } // populate CacheAttributes var requestCacheAttributesIsNull = true; request.CacheAttributes = new Amazon.StorageGateway.Model.CacheAttributes(); System.Int32?requestCacheAttributes_cacheAttributes_CacheStaleTimeoutInSecond = null; if (cmdletContext.CacheAttributes_CacheStaleTimeoutInSecond != null) { requestCacheAttributes_cacheAttributes_CacheStaleTimeoutInSecond = cmdletContext.CacheAttributes_CacheStaleTimeoutInSecond.Value; } if (requestCacheAttributes_cacheAttributes_CacheStaleTimeoutInSecond != null) { request.CacheAttributes.CacheStaleTimeoutInSeconds = requestCacheAttributes_cacheAttributes_CacheStaleTimeoutInSecond.Value; requestCacheAttributesIsNull = false; } // determine if request.CacheAttributes should be set to null if (requestCacheAttributesIsNull) { request.CacheAttributes = null; } if (cmdletContext.CaseSensitivity != null) { request.CaseSensitivity = cmdletContext.CaseSensitivity; } if (cmdletContext.DefaultStorageClass != null) { request.DefaultStorageClass = cmdletContext.DefaultStorageClass; } if (cmdletContext.FileShareARN != null) { request.FileShareARN = cmdletContext.FileShareARN; } if (cmdletContext.FileShareName != null) { request.FileShareName = cmdletContext.FileShareName; } if (cmdletContext.GuessMIMETypeEnabled != null) { request.GuessMIMETypeEnabled = cmdletContext.GuessMIMETypeEnabled.Value; } if (cmdletContext.InvalidUserList != null) { request.InvalidUserList = cmdletContext.InvalidUserList; } if (cmdletContext.KMSEncrypted != null) { request.KMSEncrypted = cmdletContext.KMSEncrypted.Value; } if (cmdletContext.KMSKey != null) { request.KMSKey = cmdletContext.KMSKey; } if (cmdletContext.ObjectACL != null) { request.ObjectACL = cmdletContext.ObjectACL; } if (cmdletContext.ReadOnly != null) { request.ReadOnly = cmdletContext.ReadOnly.Value; } if (cmdletContext.RequesterPay != null) { request.RequesterPays = cmdletContext.RequesterPay.Value; } if (cmdletContext.SMBACLEnabled != null) { request.SMBACLEnabled = cmdletContext.SMBACLEnabled.Value; } if (cmdletContext.ValidUserList != null) { request.ValidUserList = cmdletContext.ValidUserList; } 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); }
private Amazon.StorageGateway.Model.UpdateSMBFileShareResponse CallAWSServiceOperation(IAmazonStorageGateway client, Amazon.StorageGateway.Model.UpdateSMBFileShareRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Storage Gateway", "UpdateSMBFileShare"); try { #if DESKTOP return(client.UpdateSMBFileShare(request)); #elif CORECLR return(client.UpdateSMBFileShareAsync(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; } }
public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.StorageGateway.Model.UpdateSMBFileShareRequest(); if (cmdletContext.AdminUserList != null) { request.AdminUserList = cmdletContext.AdminUserList; } if (cmdletContext.DefaultStorageClass != null) { request.DefaultStorageClass = cmdletContext.DefaultStorageClass; } if (cmdletContext.FileShareARN != null) { request.FileShareARN = cmdletContext.FileShareARN; } if (cmdletContext.GuessMIMETypeEnabled != null) { request.GuessMIMETypeEnabled = cmdletContext.GuessMIMETypeEnabled.Value; } if (cmdletContext.InvalidUserList != null) { request.InvalidUserList = cmdletContext.InvalidUserList; } if (cmdletContext.KMSEncrypted != null) { request.KMSEncrypted = cmdletContext.KMSEncrypted.Value; } if (cmdletContext.KMSKey != null) { request.KMSKey = cmdletContext.KMSKey; } if (cmdletContext.ObjectACL != null) { request.ObjectACL = cmdletContext.ObjectACL; } if (cmdletContext.ReadOnly != null) { request.ReadOnly = cmdletContext.ReadOnly.Value; } if (cmdletContext.RequesterPay != null) { request.RequesterPays = cmdletContext.RequesterPay.Value; } if (cmdletContext.SMBACLEnabled != null) { request.SMBACLEnabled = cmdletContext.SMBACLEnabled.Value; } if (cmdletContext.ValidUserList != null) { request.ValidUserList = cmdletContext.ValidUserList; } 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); }