Skip to content
Merged
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,71 @@
/**
* 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.iothub.v2018_12_01_preview;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
* Public representation of one of the locations where a resource is
* provisioned.
*/
public class IotHubLocationDescription {
/**
* Azure Geo Regions.
*/
@JsonProperty(value = "location")
private String location;

/**
* Specific Role assigned to this location. Possible values include:
* 'primary', 'secondary'.
*/
@JsonProperty(value = "role")
private IotHubReplicaRoleType role;

/**
* Get azure Geo Regions.
*
* @return the location value
*/
public String location() {
return this.location;
}

/**
* Set azure Geo Regions.
*
* @param location the location value to set
* @return the IotHubLocationDescription object itself.
*/
public IotHubLocationDescription withLocation(String location) {
this.location = location;
return this;
}

/**
* Get specific Role assigned to this location. Possible values include: 'primary', 'secondary'.
*
* @return the role value
*/
public IotHubReplicaRoleType role() {
return this.role;
}

/**
* Set specific Role assigned to this location. Possible values include: 'primary', 'secondary'.
*
* @param role the role value to set
* @return the IotHubLocationDescription object itself.
*/
public IotHubLocationDescription withRole(IotHubReplicaRoleType role) {
this.role = role;
return this;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ public class IotHubProperties {
@JsonProperty(value = "features")
private Capabilities features;

/**
* Primary and secondary location for iot hub.
*/
@JsonProperty(value = "locations")
private List<IotHubLocationDescription> locations;

/**
* Get the shared access policies you can use to secure a connection to the IoT hub.
*
Expand Down Expand Up @@ -358,4 +364,24 @@ public IotHubProperties withFeatures(Capabilities features) {
return this;
}

/**
* Get primary and secondary location for iot hub.
*
* @return the locations value
*/
public List<IotHubLocationDescription> locations() {
return this.locations;
}

/**
* Set primary and secondary location for iot hub.
*
* @param locations the locations value to set
* @return the IotHubProperties object itself.
*/
public IotHubProperties withLocations(List<IotHubLocationDescription> locations) {
this.locations = locations;
return this;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/**
* 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.iothub.v2018_12_01_preview;

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

/**
* Defines values for IotHubReplicaRoleType.
*/
public final class IotHubReplicaRoleType extends ExpandableStringEnum<IotHubReplicaRoleType> {
/** Static value primary for IotHubReplicaRoleType. */
public static final IotHubReplicaRoleType PRIMARY = fromString("primary");

/** Static value secondary for IotHubReplicaRoleType. */
public static final IotHubReplicaRoleType SECONDARY = fromString("secondary");

/**
* Creates or finds a IotHubReplicaRoleType from its string representation.
* @param name a name to look for
* @return the corresponding IotHubReplicaRoleType
*/
@JsonCreator
public static IotHubReplicaRoleType fromString(String name) {
return fromString(name, IotHubReplicaRoleType.class);
}

/**
* @return known IotHubReplicaRoleType values
*/
public static Collection<IotHubReplicaRoleType> values() {
return values(IotHubReplicaRoleType.class);
}
}