Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@

import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Objects;
Expand All @@ -28,8 +32,71 @@
public class GoogleDriveConfig
// CHECKSTYLE:ON
{
@JsonProperty("folder")
private GoogleDriveFolder folder;
/** Gets or Sets resourceType */
public enum ResourceTypeEnum {
/** The SHARED_FOLDER option of this GoogleDriveConfig */
SHARED_FOLDER("SHARED_FOLDER"),

/** The SHARED_DRIVE option of this GoogleDriveConfig */
SHARED_DRIVE("SHARED_DRIVE"),

/** The UNKNOWN_DEFAULT_OPEN_API option of this GoogleDriveConfig */
UNKNOWN_DEFAULT_OPEN_API("unknown_default_open_api");

private String value;

ResourceTypeEnum(String value) {
this.value = value;
}

/**
* Get the value of the enum
*
* @return The enum value
*/
@JsonValue
@Nonnull
public String getValue() {
return value;
}

/**
* Get the String value of the enum value.
*
* @return The enum value as String
*/
@Override
@Nonnull
public String toString() {
return String.valueOf(value);
}

/**
* Get the enum value from a String value
*
* @param value The String value
* @return The enum value of type GoogleDriveConfig
*/
@JsonCreator
@Nonnull
public static ResourceTypeEnum fromValue(@Nonnull final String value) {
for (ResourceTypeEnum b : ResourceTypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
return UNKNOWN_DEFAULT_OPEN_API;
}
}

@JsonProperty("resourceType")
private ResourceTypeEnum resourceType;

@JsonProperty("resourceId")
private String resourceId;

@JsonProperty("includePaths")
private List<String> includePaths = new ArrayList<>();

@JsonAnySetter @JsonAnyGetter
private final Map<String, Object> cloudSdkCustomFields = new LinkedHashMap<>();
Expand All @@ -38,34 +105,111 @@ public class GoogleDriveConfig
protected GoogleDriveConfig() {}

/**
* Set the folder of this {@link GoogleDriveConfig} instance and return the same instance.
* Set the resourceType of this {@link GoogleDriveConfig} instance and return the same instance.
*
* @param resourceType The resourceType of this {@link GoogleDriveConfig}
* @return The same instance of this {@link GoogleDriveConfig} class
*/
@Nonnull
public GoogleDriveConfig resourceType(@Nonnull final ResourceTypeEnum resourceType) {
this.resourceType = resourceType;
return this;
}

/**
* Get resourceType
*
* @return resourceType The resourceType of this {@link GoogleDriveConfig} instance.
*/
@Nonnull
public ResourceTypeEnum getResourceType() {
return resourceType;
}

/**
* Set the resourceType of this {@link GoogleDriveConfig} instance.
*
* @param folder The folder of this {@link GoogleDriveConfig}
* @param resourceType The resourceType of this {@link GoogleDriveConfig}
*/
public void setResourceType(@Nonnull final ResourceTypeEnum resourceType) {
this.resourceType = resourceType;
}

/**
* Set the resourceId of this {@link GoogleDriveConfig} instance and return the same instance.
*
* @param resourceId The resourceId of this {@link GoogleDriveConfig}
* @return The same instance of this {@link GoogleDriveConfig} class
*/
@Nonnull
public GoogleDriveConfig folder(@Nonnull final GoogleDriveFolder folder) {
this.folder = folder;
public GoogleDriveConfig resourceId(@Nullable final String resourceId) {
this.resourceId = resourceId;
return this;
}

/**
* Get resourceId
*
* @return resourceId The resourceId of this {@link GoogleDriveConfig} instance.
*/
@Nonnull
public String getResourceId() {
return resourceId;
}

/**
* Set the resourceId of this {@link GoogleDriveConfig} instance.
*
* @param resourceId The resourceId of this {@link GoogleDriveConfig}
*/
public void setResourceId(@Nullable final String resourceId) {
this.resourceId = resourceId;
}

/**
* Set the includePaths of this {@link GoogleDriveConfig} instance and return the same instance.
*
* @param includePaths The includePaths of this {@link GoogleDriveConfig}
* @return The same instance of this {@link GoogleDriveConfig} class
*/
@Nonnull
public GoogleDriveConfig includePaths(@Nullable final List<String> includePaths) {
this.includePaths = includePaths;
return this;
}

/**
* Add one includePaths instance to this {@link GoogleDriveConfig}.
*
* @param includePathsItem The includePaths that should be added
* @return The same instance of type {@link GoogleDriveConfig}
*/
@Nonnull
public GoogleDriveConfig addIncludePathsItem(@Nonnull final String includePathsItem) {
if (this.includePaths == null) {
this.includePaths = new ArrayList<>();
}
this.includePaths.add(includePathsItem);
return this;
}

/**
* Get folder
* Get includePaths
*
* @return folder The folder of this {@link GoogleDriveConfig} instance.
* @return includePaths The includePaths of this {@link GoogleDriveConfig} instance.
*/
@Nonnull
public GoogleDriveFolder getFolder() {
return folder;
public List<String> getIncludePaths() {
return includePaths;
}

/**
* Set the folder of this {@link GoogleDriveConfig} instance.
* Set the includePaths of this {@link GoogleDriveConfig} instance.
*
* @param folder The folder of this {@link GoogleDriveConfig}
* @param includePaths The includePaths of this {@link GoogleDriveConfig}
*/
public void setFolder(@Nonnull final GoogleDriveFolder folder) {
this.folder = folder;
public void setIncludePaths(@Nullable final List<String> includePaths) {
this.includePaths = includePaths;
}

/**
Expand Down Expand Up @@ -106,7 +250,9 @@ public Object getCustomField(@Nonnull final String name) throws NoSuchElementExc
@Nonnull
public Map<String, Object> toMap() {
final Map<String, Object> declaredFields = new LinkedHashMap<>(cloudSdkCustomFields);
if (folder != null) declaredFields.put("folder", folder);
if (resourceType != null) declaredFields.put("resourceType", resourceType);
if (resourceId != null) declaredFields.put("resourceId", resourceId);
if (includePaths != null) declaredFields.put("includePaths", includePaths);
return declaredFields;
}

Expand All @@ -132,20 +278,24 @@ public boolean equals(@Nullable final java.lang.Object o) {
}
final GoogleDriveConfig googleDriveConfig = (GoogleDriveConfig) o;
return Objects.equals(this.cloudSdkCustomFields, googleDriveConfig.cloudSdkCustomFields)
&& Objects.equals(this.folder, googleDriveConfig.folder);
&& Objects.equals(this.resourceType, googleDriveConfig.resourceType)
&& Objects.equals(this.resourceId, googleDriveConfig.resourceId)
&& Objects.equals(this.includePaths, googleDriveConfig.includePaths);
}

@Override
public int hashCode() {
return Objects.hash(folder, cloudSdkCustomFields);
return Objects.hash(resourceType, resourceId, includePaths, cloudSdkCustomFields);
}

@Override
@Nonnull
public String toString() {
final StringBuilder sb = new StringBuilder();
sb.append("class GoogleDriveConfig {\n");
sb.append(" folder: ").append(toIndentedString(folder)).append("\n");
sb.append(" resourceType: ").append(toIndentedString(resourceType)).append("\n");
sb.append(" resourceId: ").append(toIndentedString(resourceId)).append("\n");
sb.append(" includePaths: ").append(toIndentedString(includePaths)).append("\n");
cloudSdkCustomFields.forEach(
(k, v) ->
sb.append(" ").append(k).append(": ").append(toIndentedString(v)).append("\n"));
Expand All @@ -168,17 +318,17 @@ private String toIndentedString(final java.lang.Object o) {
* instance with all required arguments.
*/
public static Builder create() {
return (folder) -> new GoogleDriveConfig().folder(folder);
return (resourceType) -> new GoogleDriveConfig().resourceType(resourceType);
}

/** Builder helper class. */
public interface Builder {
/**
* Set the folder of this {@link GoogleDriveConfig} instance.
* Set the resourceType of this {@link GoogleDriveConfig} instance.
*
* @param folder The folder of this {@link GoogleDriveConfig}
* @param resourceType The resourceType of this {@link GoogleDriveConfig}
* @return The GoogleDriveConfig instance.
*/
GoogleDriveConfig folder(@Nonnull final GoogleDriveFolder folder);
GoogleDriveConfig resourceType(@Nonnull final ResourceTypeEnum resourceType);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class GoogleDriveConfigurationMinimal
// CHECKSTYLE:ON
{
@JsonProperty("googleDrive")
private GoogleDriveFolderDetail googleDrive;
private GoogleDriveResourceDetail googleDrive;

@JsonAnySetter @JsonAnyGetter
private final Map<String, Object> cloudSdkCustomFields = new LinkedHashMap<>();
Expand All @@ -46,7 +46,7 @@ protected GoogleDriveConfigurationMinimal() {}
*/
@Nonnull
public GoogleDriveConfigurationMinimal googleDrive(
@Nonnull final GoogleDriveFolderDetail googleDrive) {
@Nonnull final GoogleDriveResourceDetail googleDrive) {
this.googleDrive = googleDrive;
return this;
}
Expand All @@ -57,7 +57,7 @@ public GoogleDriveConfigurationMinimal googleDrive(
* @return googleDrive The googleDrive of this {@link GoogleDriveConfigurationMinimal} instance.
*/
@Nonnull
public GoogleDriveFolderDetail getGoogleDrive() {
public GoogleDriveResourceDetail getGoogleDrive() {
return googleDrive;
}

Expand All @@ -66,7 +66,7 @@ public GoogleDriveFolderDetail getGoogleDrive() {
*
* @param googleDrive The googleDrive of this {@link GoogleDriveConfigurationMinimal}
*/
public void setGoogleDrive(@Nonnull final GoogleDriveFolderDetail googleDrive) {
public void setGoogleDrive(@Nonnull final GoogleDriveResourceDetail googleDrive) {
this.googleDrive = googleDrive;
}

Expand Down Expand Up @@ -186,6 +186,7 @@ public interface Builder {
* @param googleDrive The googleDrive of this {@link GoogleDriveConfigurationMinimal}
* @return The GoogleDriveConfigurationMinimal instance.
*/
GoogleDriveConfigurationMinimal googleDrive(@Nonnull final GoogleDriveFolderDetail googleDrive);
GoogleDriveConfigurationMinimal googleDrive(
@Nonnull final GoogleDriveResourceDetail googleDrive);
}
}
Loading
Loading