다음을 통해 공유


ResourceWithOptionalLocation Class

public class ResourceWithOptionalLocation
extends Resource

The Resource model definition with location property as optional.

Constructor Summary

Constructor Description
ResourceWithOptionalLocation()

Creates an instance of ResourceWithOptionalLocation class.

Method Summary

Modifier and Type Method and Description
static ResourceWithOptionalLocation fromJson(JsonReader jsonReader)

Reads an instance of ResourceWithOptionalLocation from the JsonReader.

String id()

Get the id property: Fully qualified resource Id for the resource.

String name()

Get the name property: The name of the resource.

JsonWriter toJson(JsonWriter jsonWriter)
String type()

Get the type property: The type of the resource.

void validate()

Validates the instance.

ResourceWithOptionalLocation withLocation(String location)
ResourceWithOptionalLocation withTags(Map<String,String> tags)

Methods inherited from ProxyResource

Methods inherited from Resource

Methods inherited from java.lang.Object

Constructor Details

ResourceWithOptionalLocation

public ResourceWithOptionalLocation()

Creates an instance of ResourceWithOptionalLocation class.

Method Details

fromJson

public static ResourceWithOptionalLocation fromJson(JsonReader jsonReader)

Reads an instance of ResourceWithOptionalLocation from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of ResourceWithOptionalLocation if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

id

public String id()

Get the id property: Fully qualified resource Id for the resource.

Overrides:

ResourceWithOptionalLocation.id()

Returns:

the id value.

name

public String name()

Get the name property: The name of the resource.

Overrides:

ResourceWithOptionalLocation.name()

Returns:

the name value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Overrides:

ResourceWithOptionalLocation.toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

type

public String type()

Get the type property: The type of the resource.

Overrides:

ResourceWithOptionalLocation.type()

Returns:

the type value.

validate

public void validate()

Validates the instance.

withLocation

public ResourceWithOptionalLocation withLocation(String location)

Overrides:

ResourceWithOptionalLocation.withLocation(String location)

Parameters:

location

withTags

public ResourceWithOptionalLocation withTags(Map tags)

Overrides:

ResourceWithOptionalLocation.withTags(Map<String,String> tags)

Parameters:

tags

Applies to