private Amazon.LakeFormation.Model.PutDataLakeSettingsResponse CallAWSServiceOperation(IAmazonLakeFormation client, Amazon.LakeFormation.Model.PutDataLakeSettingsRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS Lake Formation", "PutDataLakeSettings"); try { #if DESKTOP return(client.PutDataLakeSettings(request)); #elif CORECLR return(client.PutDataLakeSettingsAsync(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.LakeFormation.Model.PutDataLakeSettingsRequest(); if (cmdletContext.CatalogId != null) { request.CatalogId = cmdletContext.CatalogId; } // populate DataLakeSettings var requestDataLakeSettingsIsNull = true; request.DataLakeSettings = new Amazon.LakeFormation.Model.DataLakeSettings(); List <Amazon.LakeFormation.Model.PrincipalPermissions> requestDataLakeSettings_dataLakeSettings_CreateDatabaseDefaultPermission = null; if (cmdletContext.DataLakeSettings_CreateDatabaseDefaultPermission != null) { requestDataLakeSettings_dataLakeSettings_CreateDatabaseDefaultPermission = cmdletContext.DataLakeSettings_CreateDatabaseDefaultPermission; } if (requestDataLakeSettings_dataLakeSettings_CreateDatabaseDefaultPermission != null) { request.DataLakeSettings.CreateDatabaseDefaultPermissions = requestDataLakeSettings_dataLakeSettings_CreateDatabaseDefaultPermission; requestDataLakeSettingsIsNull = false; } List <Amazon.LakeFormation.Model.PrincipalPermissions> requestDataLakeSettings_dataLakeSettings_CreateTableDefaultPermission = null; if (cmdletContext.DataLakeSettings_CreateTableDefaultPermission != null) { requestDataLakeSettings_dataLakeSettings_CreateTableDefaultPermission = cmdletContext.DataLakeSettings_CreateTableDefaultPermission; } if (requestDataLakeSettings_dataLakeSettings_CreateTableDefaultPermission != null) { request.DataLakeSettings.CreateTableDefaultPermissions = requestDataLakeSettings_dataLakeSettings_CreateTableDefaultPermission; requestDataLakeSettingsIsNull = false; } List <Amazon.LakeFormation.Model.DataLakePrincipal> requestDataLakeSettings_dataLakeSettings_DataLakeAdmin = null; if (cmdletContext.DataLakeSettings_DataLakeAdmin != null) { requestDataLakeSettings_dataLakeSettings_DataLakeAdmin = cmdletContext.DataLakeSettings_DataLakeAdmin; } if (requestDataLakeSettings_dataLakeSettings_DataLakeAdmin != null) { request.DataLakeSettings.DataLakeAdmins = requestDataLakeSettings_dataLakeSettings_DataLakeAdmin; requestDataLakeSettingsIsNull = false; } List <System.String> requestDataLakeSettings_dataLakeSettings_TrustedResourceOwner = null; if (cmdletContext.DataLakeSettings_TrustedResourceOwner != null) { requestDataLakeSettings_dataLakeSettings_TrustedResourceOwner = cmdletContext.DataLakeSettings_TrustedResourceOwner; } if (requestDataLakeSettings_dataLakeSettings_TrustedResourceOwner != null) { request.DataLakeSettings.TrustedResourceOwners = requestDataLakeSettings_dataLakeSettings_TrustedResourceOwner; requestDataLakeSettingsIsNull = false; } // determine if request.DataLakeSettings should be set to null if (requestDataLakeSettingsIsNull) { request.DataLakeSettings = 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); }