PageRenderTime 35ms CodeModel.GetById 30ms app.highlight 4ms RepoModel.GetById 0ms app.codeStats 0ms

/sdk/labservices/azure-resourcemanager-labservices/src/main/java/com/azure/resourcemanager/labservices/fluent/models/UserInner.java

http://github.com/WindowsAzure/azure-sdk-for-java
Java | 171 lines | 73 code | 18 blank | 80 comment | 15 complexity | dcd6dc67e44f890fa27b6990f717043c MD5 | raw file
Possible License(s): MIT
  1// Copyright (c) Microsoft Corporation. All rights reserved.
  2// Licensed under the MIT License.
  3// Code generated by Microsoft (R) AutoRest Code Generator.
  4
  5package com.azure.resourcemanager.labservices.fluent.models;
  6
  7import com.azure.core.annotation.Fluent;
  8import com.azure.core.management.ProxyResource;
  9import com.azure.core.management.SystemData;
 10import com.azure.core.util.logging.ClientLogger;
 11import com.azure.resourcemanager.labservices.models.InvitationState;
 12import com.azure.resourcemanager.labservices.models.ProvisioningState;
 13import com.azure.resourcemanager.labservices.models.RegistrationState;
 14import com.fasterxml.jackson.annotation.JsonIgnore;
 15import com.fasterxml.jackson.annotation.JsonProperty;
 16import java.time.Duration;
 17import java.time.OffsetDateTime;
 18
 19/** User of a lab that can register for and use virtual machines within the lab. */
 20@Fluent
 21public final class UserInner extends ProxyResource {
 22    @JsonIgnore private final ClientLogger logger = new ClientLogger(UserInner.class);
 23
 24    /*
 25     * Metadata pertaining to creation and last modification of the user
 26     * resource.
 27     */
 28    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
 29    private SystemData systemData;
 30
 31    /*
 32     * User resource properties
 33     */
 34    @JsonProperty(value = "properties", required = true)
 35    private UserProperties innerProperties = new UserProperties();
 36
 37    /**
 38     * Get the systemData property: Metadata pertaining to creation and last modification of the user resource.
 39     *
 40     * @return the systemData value.
 41     */
 42    public SystemData systemData() {
 43        return this.systemData;
 44    }
 45
 46    /**
 47     * Get the innerProperties property: User resource properties.
 48     *
 49     * @return the innerProperties value.
 50     */
 51    private UserProperties innerProperties() {
 52        return this.innerProperties;
 53    }
 54
 55    /**
 56     * Get the provisioningState property: Current provisioning state of the user resource.
 57     *
 58     * @return the provisioningState value.
 59     */
 60    public ProvisioningState provisioningState() {
 61        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
 62    }
 63
 64    /**
 65     * Get the displayName property: Display name of the user, for example user's full name.
 66     *
 67     * @return the displayName value.
 68     */
 69    public String displayName() {
 70        return this.innerProperties() == null ? null : this.innerProperties().displayName();
 71    }
 72
 73    /**
 74     * Get the email property: Email address of the user.
 75     *
 76     * @return the email value.
 77     */
 78    public String email() {
 79        return this.innerProperties() == null ? null : this.innerProperties().email();
 80    }
 81
 82    /**
 83     * Set the email property: Email address of the user.
 84     *
 85     * @param email the email value to set.
 86     * @return the UserInner object itself.
 87     */
 88    public UserInner withEmail(String email) {
 89        if (this.innerProperties() == null) {
 90            this.innerProperties = new UserProperties();
 91        }
 92        this.innerProperties().withEmail(email);
 93        return this;
 94    }
 95
 96    /**
 97     * Get the registrationState property: State of the user's registration within the lab.
 98     *
 99     * @return the registrationState value.
100     */
101    public RegistrationState registrationState() {
102        return this.innerProperties() == null ? null : this.innerProperties().registrationState();
103    }
104
105    /**
106     * Get the invitationState property: State of the invitation message for the user.
107     *
108     * @return the invitationState value.
109     */
110    public InvitationState invitationState() {
111        return this.innerProperties() == null ? null : this.innerProperties().invitationState();
112    }
113
114    /**
115     * Get the invitationSent property: Date and time when the invitation message was sent to the user.
116     *
117     * @return the invitationSent value.
118     */
119    public OffsetDateTime invitationSent() {
120        return this.innerProperties() == null ? null : this.innerProperties().invitationSent();
121    }
122
123    /**
124     * Get the totalUsage property: How long the user has used their virtual machines in this lab.
125     *
126     * @return the totalUsage value.
127     */
128    public Duration totalUsage() {
129        return this.innerProperties() == null ? null : this.innerProperties().totalUsage();
130    }
131
132    /**
133     * Get the additionalUsageQuota property: The amount of usage quota time the user gets in addition to the lab usage
134     * quota.
135     *
136     * @return the additionalUsageQuota value.
137     */
138    public Duration additionalUsageQuota() {
139        return this.innerProperties() == null ? null : this.innerProperties().additionalUsageQuota();
140    }
141
142    /**
143     * Set the additionalUsageQuota property: The amount of usage quota time the user gets in addition to the lab usage
144     * quota.
145     *
146     * @param additionalUsageQuota the additionalUsageQuota value to set.
147     * @return the UserInner object itself.
148     */
149    public UserInner withAdditionalUsageQuota(Duration additionalUsageQuota) {
150        if (this.innerProperties() == null) {
151            this.innerProperties = new UserProperties();
152        }
153        this.innerProperties().withAdditionalUsageQuota(additionalUsageQuota);
154        return this;
155    }
156
157    /**
158     * Validates the instance.
159     *
160     * @throws IllegalArgumentException thrown if the instance is not valid.
161     */
162    public void validate() {
163        if (innerProperties() == null) {
164            throw logger
165                .logExceptionAsError(
166                    new IllegalArgumentException("Missing required property innerProperties in model UserInner"));
167        } else {
168            innerProperties().validate();
169        }
170    }
171}