com.google.api.services.directory.model.UserPhoto Maven / Gradle / Ivy
/*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
/*
* This code was generated by https://github.com/googleapis/google-api-java-client-services/
* Modify at your own risk.
*/
package com.google.api.services.directory.model;
/**
* Model definition for UserPhoto.
*
* This is the Java data model class that specifies how to parse/serialize into the JSON that is
* transmitted over HTTP when working with the Admin SDK API. For a detailed explanation see:
* https://developers.google.com/api-client-library/java/google-http-java-client/json
*
*
* @author Google, Inc.
*/
@SuppressWarnings("javadoc")
public final class UserPhoto extends com.google.api.client.json.GenericJson {
/**
* ETag of the resource.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String etag;
/**
* Height of the photo in pixels.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Integer height;
/**
* The ID the API uses to uniquely identify the user.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String id;
/**
* The type of the API resource. For Photo resources, this is `admin#directory#user#photo`.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String kind;
/**
* The MIME type of the photo. Allowed values are `JPEG`, `PNG`, `GIF`, `BMP`, `TIFF`, and web-
* safe base64 encoding.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String mimeType;
/**
* The user photo's upload data in [web-safe
* Base64](https://en.wikipedia.org/wiki/Base64#URL_applications) format in bytes. This means: *
* The slash (/) character is replaced with the underscore (_) character. * The plus sign (+)
* character is replaced with the hyphen (-) character. * The equals sign (=) character is
* replaced with the asterisk (*). * For padding, the period (.) character is used instead of the
* RFC-4648 baseURL definition which uses the equals sign (=) for padding. This is done to
* simplify URL-parsing. * Whatever the size of the photo being uploaded, the API downsizes it to
* 96x96 pixels.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String photoData;
/**
* The user's primary email address.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.String primaryEmail;
/**
* Width of the photo in pixels.
* The value may be {@code null}.
*/
@com.google.api.client.util.Key
private java.lang.Integer width;
/**
* ETag of the resource.
* @return value or {@code null} for none
*/
public java.lang.String getEtag() {
return etag;
}
/**
* ETag of the resource.
* @param etag etag or {@code null} for none
*/
public UserPhoto setEtag(java.lang.String etag) {
this.etag = etag;
return this;
}
/**
* Height of the photo in pixels.
* @return value or {@code null} for none
*/
public java.lang.Integer getHeight() {
return height;
}
/**
* Height of the photo in pixels.
* @param height height or {@code null} for none
*/
public UserPhoto setHeight(java.lang.Integer height) {
this.height = height;
return this;
}
/**
* The ID the API uses to uniquely identify the user.
* @return value or {@code null} for none
*/
public java.lang.String getId() {
return id;
}
/**
* The ID the API uses to uniquely identify the user.
* @param id id or {@code null} for none
*/
public UserPhoto setId(java.lang.String id) {
this.id = id;
return this;
}
/**
* The type of the API resource. For Photo resources, this is `admin#directory#user#photo`.
* @return value or {@code null} for none
*/
public java.lang.String getKind() {
return kind;
}
/**
* The type of the API resource. For Photo resources, this is `admin#directory#user#photo`.
* @param kind kind or {@code null} for none
*/
public UserPhoto setKind(java.lang.String kind) {
this.kind = kind;
return this;
}
/**
* The MIME type of the photo. Allowed values are `JPEG`, `PNG`, `GIF`, `BMP`, `TIFF`, and web-
* safe base64 encoding.
* @return value or {@code null} for none
*/
public java.lang.String getMimeType() {
return mimeType;
}
/**
* The MIME type of the photo. Allowed values are `JPEG`, `PNG`, `GIF`, `BMP`, `TIFF`, and web-
* safe base64 encoding.
* @param mimeType mimeType or {@code null} for none
*/
public UserPhoto setMimeType(java.lang.String mimeType) {
this.mimeType = mimeType;
return this;
}
/**
* The user photo's upload data in [web-safe
* Base64](https://en.wikipedia.org/wiki/Base64#URL_applications) format in bytes. This means: *
* The slash (/) character is replaced with the underscore (_) character. * The plus sign (+)
* character is replaced with the hyphen (-) character. * The equals sign (=) character is
* replaced with the asterisk (*). * For padding, the period (.) character is used instead of the
* RFC-4648 baseURL definition which uses the equals sign (=) for padding. This is done to
* simplify URL-parsing. * Whatever the size of the photo being uploaded, the API downsizes it to
* 96x96 pixels.
* @see #decodePhotoData()
* @return value or {@code null} for none
*/
public java.lang.String getPhotoData() {
return photoData;
}
/**
* The user photo's upload data in [web-safe
* Base64](https://en.wikipedia.org/wiki/Base64#URL_applications) format in bytes. This means: *
* The slash (/) character is replaced with the underscore (_) character. * The plus sign (+)
* character is replaced with the hyphen (-) character. * The equals sign (=) character is
* replaced with the asterisk (*). * For padding, the period (.) character is used instead of the
* RFC-4648 baseURL definition which uses the equals sign (=) for padding. This is done to
* simplify URL-parsing. * Whatever the size of the photo being uploaded, the API downsizes it to
* 96x96 pixels.
* @see #getPhotoData()
* @return Base64 decoded value or {@code null} for none
*
* @since 1.14
*/
public byte[] decodePhotoData() {
return com.google.api.client.util.Base64.decodeBase64(photoData);
}
/**
* The user photo's upload data in [web-safe
* Base64](https://en.wikipedia.org/wiki/Base64#URL_applications) format in bytes. This means: *
* The slash (/) character is replaced with the underscore (_) character. * The plus sign (+)
* character is replaced with the hyphen (-) character. * The equals sign (=) character is
* replaced with the asterisk (*). * For padding, the period (.) character is used instead of the
* RFC-4648 baseURL definition which uses the equals sign (=) for padding. This is done to
* simplify URL-parsing. * Whatever the size of the photo being uploaded, the API downsizes it to
* 96x96 pixels.
* @see #encodePhotoData()
* @param photoData photoData or {@code null} for none
*/
public UserPhoto setPhotoData(java.lang.String photoData) {
this.photoData = photoData;
return this;
}
/**
* The user photo's upload data in [web-safe
* Base64](https://en.wikipedia.org/wiki/Base64#URL_applications) format in bytes. This means: *
* The slash (/) character is replaced with the underscore (_) character. * The plus sign (+)
* character is replaced with the hyphen (-) character. * The equals sign (=) character is
* replaced with the asterisk (*). * For padding, the period (.) character is used instead of the
* RFC-4648 baseURL definition which uses the equals sign (=) for padding. This is done to
* simplify URL-parsing. * Whatever the size of the photo being uploaded, the API downsizes it to
* 96x96 pixels.
* @see #setPhotoData()
*
*
* The value is encoded Base64 or {@code null} for none.
*
*
* @since 1.14
*/
public UserPhoto encodePhotoData(byte[] photoData) {
this.photoData = com.google.api.client.util.Base64.encodeBase64URLSafeString(photoData);
return this;
}
/**
* The user's primary email address.
* @return value or {@code null} for none
*/
public java.lang.String getPrimaryEmail() {
return primaryEmail;
}
/**
* The user's primary email address.
* @param primaryEmail primaryEmail or {@code null} for none
*/
public UserPhoto setPrimaryEmail(java.lang.String primaryEmail) {
this.primaryEmail = primaryEmail;
return this;
}
/**
* Width of the photo in pixels.
* @return value or {@code null} for none
*/
public java.lang.Integer getWidth() {
return width;
}
/**
* Width of the photo in pixels.
* @param width width or {@code null} for none
*/
public UserPhoto setWidth(java.lang.Integer width) {
this.width = width;
return this;
}
@Override
public UserPhoto set(String fieldName, Object value) {
return (UserPhoto) super.set(fieldName, value);
}
@Override
public UserPhoto clone() {
return (UserPhoto) super.clone();
}
}