Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR] cosmos-db/resource-manager #58

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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
@@ -0,0 +1,45 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/

package com.microsoft.azure.management.cosmosdb;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
* Cosmos DB capability object.
*/
public class Capability {
/**
* Name of the Cosmos DB capability. For example, "name":
* "EnableCassandra". Current values also include "EnableTable" and
* "EnableGremlin".
*/
@JsonProperty(value = "name")
private String name;

/**
* Get the name value.
*
* @return the name value
*/
public String name() {
return this.name;
}

/**
* Set the name value.
*
* @param name the name value to set
* @return the Capability object itself.
*/
public Capability withName(String name) {
this.name = name;
return this;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* The consistency policy for the DocumentDB database account.
* The consistency policy for the Cosmos DB database account.
*/
public class ConsistencyPolicy {
/**
* The default consistency level and configuration settings of the
* DocumentDB account. Possible values include: 'Eventual', 'Session',
* 'BoundedStaleness', 'Strong'.
* The default consistency level and configuration settings of the Cosmos
* DB account. Possible values include: 'Eventual', 'Session',
* 'BoundedStaleness', 'Strong', 'ConsistentPrefix'.
*/
@JsonProperty(value = "defaultConsistencyLevel", required = true)
private DefaultConsistencyLevel defaultConsistencyLevel;
Expand All @@ -34,8 +34,8 @@ public class ConsistencyPolicy {
/**
* When used with the Bounded Staleness consistency level, this value
* represents the time amount of staleness (in seconds) tolerated. Accepted
* range for this value is 1 - 100. Required when defaultConsistencyPolicy
* is set to 'BoundedStaleness'.
* range for this value is 5 - 86400. Required when
* defaultConsistencyPolicy is set to 'BoundedStaleness'.
*/
@JsonProperty(value = "maxIntervalInSeconds")
private Integer maxIntervalInSeconds;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* Connection string for the DocumentDB account.
* Connection string for the Cosmos DB account.
*/
public class DatabaseAccountConnectionString {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,55 +8,37 @@

package com.microsoft.azure.management.cosmosdb;

import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Collection;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.microsoft.rest.ExpandableStringEnum;

/**
* Defines values for DatabaseAccountKind.
*/
public final class DatabaseAccountKind {
public final class DatabaseAccountKind extends ExpandableStringEnum<DatabaseAccountKind> {
/** Static value GlobalDocumentDB for DatabaseAccountKind. */
public static final DatabaseAccountKind GLOBAL_DOCUMENT_DB = new DatabaseAccountKind("GlobalDocumentDB");
public static final DatabaseAccountKind GLOBAL_DOCUMENT_DB = fromString("GlobalDocumentDB");

/** Static value MongoDB for DatabaseAccountKind. */
public static final DatabaseAccountKind MONGO_DB = new DatabaseAccountKind("MongoDB");
public static final DatabaseAccountKind MONGO_DB = fromString("MongoDB");

/** Static value Parse for DatabaseAccountKind. */
public static final DatabaseAccountKind PARSE = new DatabaseAccountKind("Parse");

private String value;
public static final DatabaseAccountKind PARSE = fromString("Parse");

/**
* Creates a custom value for DatabaseAccountKind.
* @param value the custom value
* Creates or finds a DatabaseAccountKind from its string representation.
* @param name a name to look for
* @return the corresponding DatabaseAccountKind
*/
public DatabaseAccountKind(String value) {
this.value = value;
}

@JsonValue
@Override
public String toString() {
return value;
@JsonCreator
public static DatabaseAccountKind fromString(String name) {
return fromString(name, DatabaseAccountKind.class);
}

@Override
public int hashCode() {
return value.hashCode();
}

@Override
public boolean equals(Object obj) {
if (!(obj instanceof DatabaseAccountKind)) {
return false;
}
if (obj == this) {
return true;
}
DatabaseAccountKind rhs = (DatabaseAccountKind) obj;
if (value == null) {
return rhs.value == null;
} else {
return value.equals(rhs.value);
}
/**
* @return known DatabaseAccountKind values
*/
public static Collection<DatabaseAccountKind> values() {
return values(DatabaseAccountKind.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,27 @@
package com.microsoft.azure.management.cosmosdb;

import java.util.Map;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.microsoft.rest.serializer.JsonFlatten;

/**
* Parameters for patching Azure DocumentDB database account properties.
* Parameters for patching Azure Cosmos DB database account properties.
*/
@JsonFlatten
public class DatabaseAccountPatchParameters {
/**
* The tags property.
*/
@JsonProperty(value = "tags", required = true)
@JsonProperty(value = "tags")
private Map<String, String> tags;

/**
* List of Cosmos DB capabilities for the account.
*/
@JsonProperty(value = "properties.capabilities")
private List<Capability> capabilities;

/**
* Get the tags value.
*
Expand All @@ -41,4 +50,24 @@ public DatabaseAccountPatchParameters withTags(Map<String, String> tags) {
return this;
}

/**
* Get the capabilities value.
*
* @return the capabilities value
*/
public List<Capability> capabilities() {
return this.capabilities;
}

/**
* Set the capabilities value.
*
* @param capabilities the capabilities value to set
* @return the DatabaseAccountPatchParameters object itself.
*/
public DatabaseAccountPatchParameters withCapabilities(List<Capability> capabilities) {
this.capabilities = capabilities;
return this;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ public enum DefaultConsistencyLevel {
BOUNDED_STALENESS("BoundedStaleness"),

/** Enum value Strong. */
STRONG("Strong");
STRONG("Strong"),

/** Enum value ConsistentPrefix. */
CONSISTENT_PREFIX("ConsistentPrefix");

/** The actual serialized value for a DefaultConsistencyLevel instance. */
private String value;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/

package com.microsoft.azure.management.cosmosdb;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
* Error Response.
*/
public class ErrorResponse {
/**
* Error code.
*/
@JsonProperty(value = "code")
private String code;

/**
* Error message indicating why the operation failed.
*/
@JsonProperty(value = "message")
private String message;

/**
* Get the code value.
*
* @return the code value
*/
public String code() {
return this.code;
}

/**
* Set the code value.
*
* @param code the code value to set
* @return the ErrorResponse object itself.
*/
public ErrorResponse withCode(String code) {
this.code = code;
return this;
}

/**
* Get the message value.
*
* @return the message value
*/
public String message() {
return this.message;
}

/**
* Set the message value.
*
* @param message the message value to set
* @return the ErrorResponse object itself.
*/
public ErrorResponse withMessage(String message) {
this.message = message;
return this;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for
* license information.
*
* Code generated by Microsoft (R) AutoRest Code Generator.
*/

package com.microsoft.azure.management.cosmosdb;

import com.microsoft.rest.RestException;
import okhttp3.ResponseBody;
import retrofit2.Response;

/**
* Exception thrown for an invalid response with ErrorResponse information.
*/
public class ErrorResponseException extends RestException {
/**
* Initializes a new instance of the ErrorResponseException class.
*
* @param message the exception message or the response content if a message is not available
* @param response the HTTP response
*/
public ErrorResponseException(final String message, final Response<ResponseBody> response) {
super(message, response);
}

/**
* Initializes a new instance of the ErrorResponseException class.
*
* @param message the exception message or the response content if a message is not available
* @param response the HTTP response
* @param body the deserialized response body
*/
public ErrorResponseException(final String message, final Response<ResponseBody> response, final ErrorResponse body) {
super(message, response, body);
}

@Override
public ErrorResponse body() {
return (ErrorResponse) super.body();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
package com.microsoft.azure.management.cosmosdb;

import java.util.List;
import com.microsoft.azure.management.cosmosdb.implementation.FailoverPolicyInner;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
Expand All @@ -19,15 +18,15 @@ public class FailoverPolicies {
/**
* List of failover policies.
*/
@JsonProperty(value = "failoverPolicies")
private List<FailoverPolicyInner> failoverPolicies;
@JsonProperty(value = "failoverPolicies", required = true)
private List<FailoverPolicy> failoverPolicies;

/**
* Get the failoverPolicies value.
*
* @return the failoverPolicies value
*/
public List<FailoverPolicyInner> failoverPolicies() {
public List<FailoverPolicy> failoverPolicies() {
return this.failoverPolicies;
}

Expand All @@ -37,7 +36,7 @@ public List<FailoverPolicyInner> failoverPolicies() {
* @param failoverPolicies the failoverPolicies value to set
* @return the FailoverPolicies object itself.
*/
public FailoverPolicies withFailoverPolicies(List<FailoverPolicyInner> failoverPolicies) {
public FailoverPolicies withFailoverPolicies(List<FailoverPolicy> failoverPolicies) {
this.failoverPolicies = failoverPolicies;
return this;
}
Expand Down
Loading