/*
 * Cloudera Manager API
 * <h1>Cloudera Manager API v57</h1>       <p>Introduced in Cloudera Manager 7.13.1</p>       <p><a href=\"http://www.cloudera.com/documentation.html\">Cloudera Product Documentation</a></p>
 *
 * OpenAPI spec version: 7.13.1
 * 
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */

package com.cloudera.api.swagger.model;

import java.util.Objects;
import java.util.Arrays;
import com.cloudera.api.swagger.model.ApiRangerReplicationHdfsToAdlsArgs;
import com.cloudera.api.swagger.model.ApiRangerReplicationHdfsToGcsArgs;
import com.cloudera.api.swagger.model.ApiRangerReplicationHdfsToS3Args;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Arguments for TRANSFORMING Ranger services and policies, executed after EXPORT (see ApiRangerReplicationExportArgs). &lt;p&gt; Note that if replication is from &lt;b&gt;on-prem to cloud&lt;/b&gt;, and it contains a &lt;b&gt;Ranger service with type HDFS&lt;/b&gt;, then depending on the cloud provider, one of the following must be provided: #getHdfsToAdlsArgs(), #getHdfsToS3Args(), #getHdfsToGcsArgs(). &lt;b&gt;Otherwise, providing this information is not required!&lt;/b&gt;
 */
@Schema(description = "Arguments for TRANSFORMING Ranger services and policies, executed after EXPORT (see ApiRangerReplicationExportArgs). <p> Note that if replication is from <b>on-prem to cloud</b>, and it contains a <b>Ranger service with type HDFS</b>, then depending on the cloud provider, one of the following must be provided: #getHdfsToAdlsArgs(), #getHdfsToS3Args(), #getHdfsToGcsArgs(). <b>Otherwise, providing this information is not required!</b>")
@javax.annotation.Generated(value = "io.swagger.codegen.v3.generators.java.JavaClientCodegen", date = "2026-05-19T08:29:59.033Z[Etc/UTC]")

public class ApiRangerReplicationTransformArgs {
  @SerializedName("rangerServiceNamesMapping")
  private Map<String, String> rangerServiceNamesMapping = null;

  @SerializedName("rangerUsersMapping")
  private Map<String, String> rangerUsersMapping = null;

  @SerializedName("rangerResourcesMapping")
  private Map<String, String> rangerResourcesMapping = null;

  @SerializedName("hiveUrlsMapping")
  private Map<String, String> hiveUrlsMapping = null;

  @SerializedName("hdfsToAdlsArgs")
  private ApiRangerReplicationHdfsToAdlsArgs hdfsToAdlsArgs = null;

  @SerializedName("hdfsToS3Args")
  private ApiRangerReplicationHdfsToS3Args hdfsToS3Args = null;

  @SerializedName("hdfsToGcsArgs")
  private ApiRangerReplicationHdfsToGcsArgs hdfsToGcsArgs = null;

  public ApiRangerReplicationTransformArgs rangerServiceNamesMapping(Map<String, String> rangerServiceNamesMapping) {
    this.rangerServiceNamesMapping = rangerServiceNamesMapping;
    return this;
  }

  public ApiRangerReplicationTransformArgs putRangerServiceNamesMappingItem(String key, String rangerServiceNamesMappingItem) {
    if (this.rangerServiceNamesMapping == null) {
      this.rangerServiceNamesMapping = new HashMap<>();
    }
    this.rangerServiceNamesMapping.put(key, rangerServiceNamesMappingItem);
    return this;
  }

   /**
   * A mapping between source to destination ranger services. &lt;p&gt; Note that if a mapping is not given for a service then it will stay the same on the destination. &lt;p&gt; Example: {\&quot;cm_hdfs\&quot;:\&quot;dr_hdfs\&quot;, \&quot;cm_hive\&quot;:\&quot;dr_hive\&quot;} &lt;br&gt; Default: empty or null, every service name will stay the same on the destination
   * @return rangerServiceNamesMapping
  **/
  @Schema(description = "A mapping between source to destination ranger services. <p> Note that if a mapping is not given for a service then it will stay the same on the destination. <p> Example: {\"cm_hdfs\":\"dr_hdfs\", \"cm_hive\":\"dr_hive\"} <br> Default: empty or null, every service name will stay the same on the destination")
  public Map<String, String> getRangerServiceNamesMapping() {
    return rangerServiceNamesMapping;
  }

  public void setRangerServiceNamesMapping(Map<String, String> rangerServiceNamesMapping) {
    this.rangerServiceNamesMapping = rangerServiceNamesMapping;
  }

  public ApiRangerReplicationTransformArgs rangerUsersMapping(Map<String, String> rangerUsersMapping) {
    this.rangerUsersMapping = rangerUsersMapping;
    return this;
  }

  public ApiRangerReplicationTransformArgs putRangerUsersMappingItem(String key, String rangerUsersMappingItem) {
    if (this.rangerUsersMapping == null) {
      this.rangerUsersMapping = new HashMap<>();
    }
    this.rangerUsersMapping.put(key, rangerUsersMappingItem);
    return this;
  }

   /**
   * A mapping between source to destination ranger usernames. &lt;p&gt; Note that if a mapping is not given for a username then it will stay the same on the destination. &lt;p&gt; Example: {\&quot;testuser1\&quot;:\&quot;testuser1@host.com\&quot;, \&quot;testuser2\&quot;:\&quot;testuser2@host.com\&quot; }&lt;br&gt; Default: empty or null, every username will stay the same on the destination
   * @return rangerUsersMapping
  **/
  @Schema(description = "A mapping between source to destination ranger usernames. <p> Note that if a mapping is not given for a username then it will stay the same on the destination. <p> Example: {\"testuser1\":\"testuser1@host.com\", \"testuser2\":\"testuser2@host.com\" }<br> Default: empty or null, every username will stay the same on the destination")
  public Map<String, String> getRangerUsersMapping() {
    return rangerUsersMapping;
  }

  public void setRangerUsersMapping(Map<String, String> rangerUsersMapping) {
    this.rangerUsersMapping = rangerUsersMapping;
  }

  public ApiRangerReplicationTransformArgs rangerResourcesMapping(Map<String, String> rangerResourcesMapping) {
    this.rangerResourcesMapping = rangerResourcesMapping;
    return this;
  }

  public ApiRangerReplicationTransformArgs putRangerResourcesMappingItem(String key, String rangerResourcesMappingItem) {
    if (this.rangerResourcesMapping == null) {
      this.rangerResourcesMapping = new HashMap<>();
    }
    this.rangerResourcesMapping.put(key, rangerResourcesMappingItem);
    return this;
  }

   /**
   * A mapping between source to destination ranger resources. &lt;p&gt; If a mapping is not given for a resource then it will stay the same on the destination. &lt;p&gt; &lt;b&gt;Example&lt;/b&gt;: &lt;br&gt; {\&quot;/srcdir1/srcfile1\&quot;: \&quot;/destdir1/destfile1\&quot;, \&quot;src_url.com\&quot;: \&quot;dest_url.com\&quot;, \&quot;source_db\&quot;: \&quot;dest_db\&quot;, \&quot;source_table\&quot;:\&quot;dest_table\&quot;} } &lt;br&gt; Default: empty or null, every resource will remain the same on destination &lt;p&gt; If replication contains &lt;b&gt;HDFS Ranger service type&lt;/b&gt; and replication is done from on-prem to cloud, then for transforming HDFS Ranger service policies to Cloud policies &lt;b&gt;NO resource mapping is needed&lt;/b&gt;. Instead, provide one of the following: #getHdfsToAdlsArgs(), #getHdfsToS3Args(), #getHdfsToGcsArgs() &lt;p&gt; &lt;b&gt;HIVE prefixed based resource URL replacement is supported&lt;/b&gt;, but it should be provided in a &lt;b&gt;different mapping&lt;/b&gt;, for more info see #getHiveUrlsMapping().
   * @return rangerResourcesMapping
  **/
  @Schema(description = "A mapping between source to destination ranger resources. <p> If a mapping is not given for a resource then it will stay the same on the destination. <p> <b>Example</b>: <br> {\"/srcdir1/srcfile1\": \"/destdir1/destfile1\", \"src_url.com\": \"dest_url.com\", \"source_db\": \"dest_db\", \"source_table\":\"dest_table\"} } <br> Default: empty or null, every resource will remain the same on destination <p> If replication contains <b>HDFS Ranger service type</b> and replication is done from on-prem to cloud, then for transforming HDFS Ranger service policies to Cloud policies <b>NO resource mapping is needed</b>. Instead, provide one of the following: #getHdfsToAdlsArgs(), #getHdfsToS3Args(), #getHdfsToGcsArgs() <p> <b>HIVE prefixed based resource URL replacement is supported</b>, but it should be provided in a <b>different mapping</b>, for more info see #getHiveUrlsMapping().")
  public Map<String, String> getRangerResourcesMapping() {
    return rangerResourcesMapping;
  }

  public void setRangerResourcesMapping(Map<String, String> rangerResourcesMapping) {
    this.rangerResourcesMapping = rangerResourcesMapping;
  }

  public ApiRangerReplicationTransformArgs hiveUrlsMapping(Map<String, String> hiveUrlsMapping) {
    this.hiveUrlsMapping = hiveUrlsMapping;
    return this;
  }

  public ApiRangerReplicationTransformArgs putHiveUrlsMappingItem(String key, String hiveUrlsMappingItem) {
    if (this.hiveUrlsMapping == null) {
      this.hiveUrlsMapping = new HashMap<>();
    }
    this.hiveUrlsMapping.put(key, hiveUrlsMappingItem);
    return this;
  }

   /**
   * Used for &lt;b&gt;HIVE prefixed based resource URL replacement&lt;/b&gt;. &lt;p&gt; &lt;b&gt;For instance&lt;/b&gt;, if Hive resource URLs on &lt;b&gt;source&lt;/b&gt; are: &lt;ul&gt; &lt;li&gt;hdfs://namenodehost:8020/user/hive/warehouse/table1&lt;/li&gt; &lt;li&gt;hdfs://namenodehost:8020/user/hive/warehouse/table2&lt;/li&gt; &lt;/ul&gt; and &lt;b&gt;destination is Amazon S3&lt;/b&gt;, and the resource mapping contains the following entry: &lt;br&gt; \&quot;hdfs://namenodehost:8020/user/hive/warehouse\&quot;: \&quot;s3a://bucket\&quot; &lt;br&gt; then after transformation hive urls will be: &lt;ul&gt; &lt;li&gt;s3a://bucket/table1&lt;/li&gt; &lt;li&gt;s3a://bucket/table2&lt;/li&gt; &lt;/ul&gt; Default: empty or null, every HIVE URL will remain the same on destination.
   * @return hiveUrlsMapping
  **/
  @Schema(description = "Used for <b>HIVE prefixed based resource URL replacement</b>. <p> <b>For instance</b>, if Hive resource URLs on <b>source</b> are: <ul> <li>hdfs://namenodehost:8020/user/hive/warehouse/table1</li> <li>hdfs://namenodehost:8020/user/hive/warehouse/table2</li> </ul> and <b>destination is Amazon S3</b>, and the resource mapping contains the following entry: <br> \"hdfs://namenodehost:8020/user/hive/warehouse\": \"s3a://bucket\" <br> then after transformation hive urls will be: <ul> <li>s3a://bucket/table1</li> <li>s3a://bucket/table2</li> </ul> Default: empty or null, every HIVE URL will remain the same on destination.")
  public Map<String, String> getHiveUrlsMapping() {
    return hiveUrlsMapping;
  }

  public void setHiveUrlsMapping(Map<String, String> hiveUrlsMapping) {
    this.hiveUrlsMapping = hiveUrlsMapping;
  }

  public ApiRangerReplicationTransformArgs hdfsToAdlsArgs(ApiRangerReplicationHdfsToAdlsArgs hdfsToAdlsArgs) {
    this.hdfsToAdlsArgs = hdfsToAdlsArgs;
    return this;
  }

   /**
   * Get hdfsToAdlsArgs
   * @return hdfsToAdlsArgs
  **/
  @Schema(description = "")
  public ApiRangerReplicationHdfsToAdlsArgs getHdfsToAdlsArgs() {
    return hdfsToAdlsArgs;
  }

  public void setHdfsToAdlsArgs(ApiRangerReplicationHdfsToAdlsArgs hdfsToAdlsArgs) {
    this.hdfsToAdlsArgs = hdfsToAdlsArgs;
  }

  public ApiRangerReplicationTransformArgs hdfsToS3Args(ApiRangerReplicationHdfsToS3Args hdfsToS3Args) {
    this.hdfsToS3Args = hdfsToS3Args;
    return this;
  }

   /**
   * Get hdfsToS3Args
   * @return hdfsToS3Args
  **/
  @Schema(description = "")
  public ApiRangerReplicationHdfsToS3Args getHdfsToS3Args() {
    return hdfsToS3Args;
  }

  public void setHdfsToS3Args(ApiRangerReplicationHdfsToS3Args hdfsToS3Args) {
    this.hdfsToS3Args = hdfsToS3Args;
  }

  public ApiRangerReplicationTransformArgs hdfsToGcsArgs(ApiRangerReplicationHdfsToGcsArgs hdfsToGcsArgs) {
    this.hdfsToGcsArgs = hdfsToGcsArgs;
    return this;
  }

   /**
   * Get hdfsToGcsArgs
   * @return hdfsToGcsArgs
  **/
  @Schema(description = "")
  public ApiRangerReplicationHdfsToGcsArgs getHdfsToGcsArgs() {
    return hdfsToGcsArgs;
  }

  public void setHdfsToGcsArgs(ApiRangerReplicationHdfsToGcsArgs hdfsToGcsArgs) {
    this.hdfsToGcsArgs = hdfsToGcsArgs;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ApiRangerReplicationTransformArgs apiRangerReplicationTransformArgs = (ApiRangerReplicationTransformArgs) o;
    return Objects.equals(this.rangerServiceNamesMapping, apiRangerReplicationTransformArgs.rangerServiceNamesMapping) &&
        Objects.equals(this.rangerUsersMapping, apiRangerReplicationTransformArgs.rangerUsersMapping) &&
        Objects.equals(this.rangerResourcesMapping, apiRangerReplicationTransformArgs.rangerResourcesMapping) &&
        Objects.equals(this.hiveUrlsMapping, apiRangerReplicationTransformArgs.hiveUrlsMapping) &&
        Objects.equals(this.hdfsToAdlsArgs, apiRangerReplicationTransformArgs.hdfsToAdlsArgs) &&
        Objects.equals(this.hdfsToS3Args, apiRangerReplicationTransformArgs.hdfsToS3Args) &&
        Objects.equals(this.hdfsToGcsArgs, apiRangerReplicationTransformArgs.hdfsToGcsArgs);
  }

  @Override
  public int hashCode() {
    return Objects.hash(rangerServiceNamesMapping, rangerUsersMapping, rangerResourcesMapping, hiveUrlsMapping, hdfsToAdlsArgs, hdfsToS3Args, hdfsToGcsArgs);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ApiRangerReplicationTransformArgs {\n");
    
    sb.append("    rangerServiceNamesMapping: ").append(toIndentedString(rangerServiceNamesMapping)).append("\n");
    sb.append("    rangerUsersMapping: ").append(toIndentedString(rangerUsersMapping)).append("\n");
    sb.append("    rangerResourcesMapping: ").append(toIndentedString(rangerResourcesMapping)).append("\n");
    sb.append("    hiveUrlsMapping: ").append(toIndentedString(hiveUrlsMapping)).append("\n");
    sb.append("    hdfsToAdlsArgs: ").append(toIndentedString(hdfsToAdlsArgs)).append("\n");
    sb.append("    hdfsToS3Args: ").append(toIndentedString(hdfsToS3Args)).append("\n");
    sb.append("    hdfsToGcsArgs: ").append(toIndentedString(hdfsToGcsArgs)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}
