com.azure.resourcemanager.mediaservices.fluent.models.StreamingEndpointProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-mediaservices Show documentation
Show all versions of azure-resourcemanager-mediaservices Show documentation
This package contains Microsoft Azure SDK for MediaServices Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. This Swagger was generated by the API Framework. Package tag package-account-2023-01.
The newest version!
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mediaservices.fluent.models;
import com.azure.core.annotation.Fluent;
import com.azure.core.util.CoreUtils;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.mediaservices.models.CrossSiteAccessPolicies;
import com.azure.resourcemanager.mediaservices.models.StreamingEndpointAccessControl;
import com.azure.resourcemanager.mediaservices.models.StreamingEndpointResourceState;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.List;
/**
* The streaming endpoint properties.
*/
@Fluent
public final class StreamingEndpointProperties implements JsonSerializable {
/*
* The streaming endpoint description.
*/
private String description;
/*
* The number of scale units. Use the Scale operation to adjust this value.
*/
private int scaleUnits;
/*
* This feature is deprecated, do not set a value for this property.
*/
private String availabilitySetName;
/*
* The access control definition of the streaming endpoint.
*/
private StreamingEndpointAccessControl accessControl;
/*
* Max cache age
*/
private Long maxCacheAge;
/*
* The custom host names of the streaming endpoint
*/
private List customHostNames;
/*
* The streaming endpoint host name.
*/
private String hostname;
/*
* The CDN enabled flag.
*/
private Boolean cdnEnabled;
/*
* The CDN provider name.
*/
private String cdnProvider;
/*
* The CDN profile name.
*/
private String cdnProfile;
/*
* The provisioning state of the streaming endpoint.
*/
private String provisioningState;
/*
* The resource state of the streaming endpoint.
*/
private StreamingEndpointResourceState resourceState;
/*
* The streaming endpoint access policies.
*/
private CrossSiteAccessPolicies crossSiteAccessPolicies;
/*
* The free trial expiration time.
*/
private OffsetDateTime freeTrialEndTime;
/*
* The exact time the streaming endpoint was created.
*/
private OffsetDateTime created;
/*
* The exact time the streaming endpoint was last modified.
*/
private OffsetDateTime lastModified;
/**
* Creates an instance of StreamingEndpointProperties class.
*/
public StreamingEndpointProperties() {
}
/**
* Get the description property: The streaming endpoint description.
*
* @return the description value.
*/
public String description() {
return this.description;
}
/**
* Set the description property: The streaming endpoint description.
*
* @param description the description value to set.
* @return the StreamingEndpointProperties object itself.
*/
public StreamingEndpointProperties withDescription(String description) {
this.description = description;
return this;
}
/**
* Get the scaleUnits property: The number of scale units. Use the Scale operation to adjust this value.
*
* @return the scaleUnits value.
*/
public int scaleUnits() {
return this.scaleUnits;
}
/**
* Set the scaleUnits property: The number of scale units. Use the Scale operation to adjust this value.
*
* @param scaleUnits the scaleUnits value to set.
* @return the StreamingEndpointProperties object itself.
*/
public StreamingEndpointProperties withScaleUnits(int scaleUnits) {
this.scaleUnits = scaleUnits;
return this;
}
/**
* Get the availabilitySetName property: This feature is deprecated, do not set a value for this property.
*
* @return the availabilitySetName value.
*/
public String availabilitySetName() {
return this.availabilitySetName;
}
/**
* Set the availabilitySetName property: This feature is deprecated, do not set a value for this property.
*
* @param availabilitySetName the availabilitySetName value to set.
* @return the StreamingEndpointProperties object itself.
*/
public StreamingEndpointProperties withAvailabilitySetName(String availabilitySetName) {
this.availabilitySetName = availabilitySetName;
return this;
}
/**
* Get the accessControl property: The access control definition of the streaming endpoint.
*
* @return the accessControl value.
*/
public StreamingEndpointAccessControl accessControl() {
return this.accessControl;
}
/**
* Set the accessControl property: The access control definition of the streaming endpoint.
*
* @param accessControl the accessControl value to set.
* @return the StreamingEndpointProperties object itself.
*/
public StreamingEndpointProperties withAccessControl(StreamingEndpointAccessControl accessControl) {
this.accessControl = accessControl;
return this;
}
/**
* Get the maxCacheAge property: Max cache age.
*
* @return the maxCacheAge value.
*/
public Long maxCacheAge() {
return this.maxCacheAge;
}
/**
* Set the maxCacheAge property: Max cache age.
*
* @param maxCacheAge the maxCacheAge value to set.
* @return the StreamingEndpointProperties object itself.
*/
public StreamingEndpointProperties withMaxCacheAge(Long maxCacheAge) {
this.maxCacheAge = maxCacheAge;
return this;
}
/**
* Get the customHostNames property: The custom host names of the streaming endpoint.
*
* @return the customHostNames value.
*/
public List customHostNames() {
return this.customHostNames;
}
/**
* Set the customHostNames property: The custom host names of the streaming endpoint.
*
* @param customHostNames the customHostNames value to set.
* @return the StreamingEndpointProperties object itself.
*/
public StreamingEndpointProperties withCustomHostNames(List customHostNames) {
this.customHostNames = customHostNames;
return this;
}
/**
* Get the hostname property: The streaming endpoint host name.
*
* @return the hostname value.
*/
public String hostname() {
return this.hostname;
}
/**
* Get the cdnEnabled property: The CDN enabled flag.
*
* @return the cdnEnabled value.
*/
public Boolean cdnEnabled() {
return this.cdnEnabled;
}
/**
* Set the cdnEnabled property: The CDN enabled flag.
*
* @param cdnEnabled the cdnEnabled value to set.
* @return the StreamingEndpointProperties object itself.
*/
public StreamingEndpointProperties withCdnEnabled(Boolean cdnEnabled) {
this.cdnEnabled = cdnEnabled;
return this;
}
/**
* Get the cdnProvider property: The CDN provider name.
*
* @return the cdnProvider value.
*/
public String cdnProvider() {
return this.cdnProvider;
}
/**
* Set the cdnProvider property: The CDN provider name.
*
* @param cdnProvider the cdnProvider value to set.
* @return the StreamingEndpointProperties object itself.
*/
public StreamingEndpointProperties withCdnProvider(String cdnProvider) {
this.cdnProvider = cdnProvider;
return this;
}
/**
* Get the cdnProfile property: The CDN profile name.
*
* @return the cdnProfile value.
*/
public String cdnProfile() {
return this.cdnProfile;
}
/**
* Set the cdnProfile property: The CDN profile name.
*
* @param cdnProfile the cdnProfile value to set.
* @return the StreamingEndpointProperties object itself.
*/
public StreamingEndpointProperties withCdnProfile(String cdnProfile) {
this.cdnProfile = cdnProfile;
return this;
}
/**
* Get the provisioningState property: The provisioning state of the streaming endpoint.
*
* @return the provisioningState value.
*/
public String provisioningState() {
return this.provisioningState;
}
/**
* Get the resourceState property: The resource state of the streaming endpoint.
*
* @return the resourceState value.
*/
public StreamingEndpointResourceState resourceState() {
return this.resourceState;
}
/**
* Get the crossSiteAccessPolicies property: The streaming endpoint access policies.
*
* @return the crossSiteAccessPolicies value.
*/
public CrossSiteAccessPolicies crossSiteAccessPolicies() {
return this.crossSiteAccessPolicies;
}
/**
* Set the crossSiteAccessPolicies property: The streaming endpoint access policies.
*
* @param crossSiteAccessPolicies the crossSiteAccessPolicies value to set.
* @return the StreamingEndpointProperties object itself.
*/
public StreamingEndpointProperties withCrossSiteAccessPolicies(CrossSiteAccessPolicies crossSiteAccessPolicies) {
this.crossSiteAccessPolicies = crossSiteAccessPolicies;
return this;
}
/**
* Get the freeTrialEndTime property: The free trial expiration time.
*
* @return the freeTrialEndTime value.
*/
public OffsetDateTime freeTrialEndTime() {
return this.freeTrialEndTime;
}
/**
* Get the created property: The exact time the streaming endpoint was created.
*
* @return the created value.
*/
public OffsetDateTime created() {
return this.created;
}
/**
* Get the lastModified property: The exact time the streaming endpoint was last modified.
*
* @return the lastModified value.
*/
public OffsetDateTime lastModified() {
return this.lastModified;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (accessControl() != null) {
accessControl().validate();
}
if (crossSiteAccessPolicies() != null) {
crossSiteAccessPolicies().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeIntField("scaleUnits", this.scaleUnits);
jsonWriter.writeStringField("description", this.description);
jsonWriter.writeStringField("availabilitySetName", this.availabilitySetName);
jsonWriter.writeJsonField("accessControl", this.accessControl);
jsonWriter.writeNumberField("maxCacheAge", this.maxCacheAge);
jsonWriter.writeArrayField("customHostNames", this.customHostNames,
(writer, element) -> writer.writeString(element));
jsonWriter.writeBooleanField("cdnEnabled", this.cdnEnabled);
jsonWriter.writeStringField("cdnProvider", this.cdnProvider);
jsonWriter.writeStringField("cdnProfile", this.cdnProfile);
jsonWriter.writeJsonField("crossSiteAccessPolicies", this.crossSiteAccessPolicies);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of StreamingEndpointProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of StreamingEndpointProperties if the JsonReader was pointing to an instance of it, or null
* if it was pointing to JSON null.
* @throws IllegalStateException If the deserialized JSON object was missing any required properties.
* @throws IOException If an error occurs while reading the StreamingEndpointProperties.
*/
public static StreamingEndpointProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
StreamingEndpointProperties deserializedStreamingEndpointProperties = new StreamingEndpointProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("scaleUnits".equals(fieldName)) {
deserializedStreamingEndpointProperties.scaleUnits = reader.getInt();
} else if ("description".equals(fieldName)) {
deserializedStreamingEndpointProperties.description = reader.getString();
} else if ("availabilitySetName".equals(fieldName)) {
deserializedStreamingEndpointProperties.availabilitySetName = reader.getString();
} else if ("accessControl".equals(fieldName)) {
deserializedStreamingEndpointProperties.accessControl
= StreamingEndpointAccessControl.fromJson(reader);
} else if ("maxCacheAge".equals(fieldName)) {
deserializedStreamingEndpointProperties.maxCacheAge = reader.getNullable(JsonReader::getLong);
} else if ("customHostNames".equals(fieldName)) {
List customHostNames = reader.readArray(reader1 -> reader1.getString());
deserializedStreamingEndpointProperties.customHostNames = customHostNames;
} else if ("hostName".equals(fieldName)) {
deserializedStreamingEndpointProperties.hostname = reader.getString();
} else if ("cdnEnabled".equals(fieldName)) {
deserializedStreamingEndpointProperties.cdnEnabled = reader.getNullable(JsonReader::getBoolean);
} else if ("cdnProvider".equals(fieldName)) {
deserializedStreamingEndpointProperties.cdnProvider = reader.getString();
} else if ("cdnProfile".equals(fieldName)) {
deserializedStreamingEndpointProperties.cdnProfile = reader.getString();
} else if ("provisioningState".equals(fieldName)) {
deserializedStreamingEndpointProperties.provisioningState = reader.getString();
} else if ("resourceState".equals(fieldName)) {
deserializedStreamingEndpointProperties.resourceState
= StreamingEndpointResourceState.fromString(reader.getString());
} else if ("crossSiteAccessPolicies".equals(fieldName)) {
deserializedStreamingEndpointProperties.crossSiteAccessPolicies
= CrossSiteAccessPolicies.fromJson(reader);
} else if ("freeTrialEndTime".equals(fieldName)) {
deserializedStreamingEndpointProperties.freeTrialEndTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("created".equals(fieldName)) {
deserializedStreamingEndpointProperties.created = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("lastModified".equals(fieldName)) {
deserializedStreamingEndpointProperties.lastModified = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else {
reader.skipChildren();
}
}
return deserializedStreamingEndpointProperties;
});
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy