All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.softlayer.api.service.user.customer.ApiAuthentication Maven / Gradle / Ivy

There is a newer version: 0.3.4
Show newest version
package com.softlayer.api.service.user.customer;

import com.softlayer.api.ApiClient;
import com.softlayer.api.ResponseHandler;
import com.softlayer.api.annotation.ApiMethod;
import com.softlayer.api.annotation.ApiProperty;
import com.softlayer.api.annotation.ApiType;
import com.softlayer.api.service.Entity;
import com.softlayer.api.service.user.Customer;
import java.util.concurrent.Future;

/**
 * The SoftLayer_User_Customer_ApiAuthentication type contains user's authentication key(s).
 *
 * @see SoftLayer_User_Customer_ApiAuthentication
 */
@ApiType("SoftLayer_User_Customer_ApiAuthentication")
public class ApiAuthentication extends Entity {

    /**
     * The user who owns the api authentication key.
     */
    @ApiProperty
    protected Customer user;

    public Customer getUser() {
        return user;
    }

    public void setUser(Customer user) {
        this.user = user;
    }

    /**
     * The user's authentication key for API access.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected String authenticationKey;

    public String getAuthenticationKey() {
        return authenticationKey;
    }

    public void setAuthenticationKey(String authenticationKey) {
        authenticationKeySpecified = true;
        this.authenticationKey = authenticationKey;
    }

    protected boolean authenticationKeySpecified;

    public boolean isAuthenticationKeySpecified() {
        return authenticationKeySpecified;
    }

    public void unsetAuthenticationKey() {
        authenticationKey = null;
        authenticationKeySpecified = false;
    }

    /**
     * The user's API authentication identifying number.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected Long id;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        idSpecified = true;
        this.id = id;
    }

    protected boolean idSpecified;

    public boolean isIdSpecified() {
        return idSpecified;
    }

    public void unsetId() {
        id = null;
        idSpecified = false;
    }

    /**
     * The IP addresses or IP ranges from which this user may access the SoftLayer API. Specify subnets in CIDR format and separate multiple addresses and subnets by commas. You may combine IPv4 and IPv6 addresses and subnets, for example: 192.168.0.0/16,fe80:021b::0/64.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected String ipAddressRestriction;

    public String getIpAddressRestriction() {
        return ipAddressRestriction;
    }

    public void setIpAddressRestriction(String ipAddressRestriction) {
        ipAddressRestrictionSpecified = true;
        this.ipAddressRestriction = ipAddressRestriction;
    }

    protected boolean ipAddressRestrictionSpecified;

    public boolean isIpAddressRestrictionSpecified() {
        return ipAddressRestrictionSpecified;
    }

    public void unsetIpAddressRestriction() {
        ipAddressRestriction = null;
        ipAddressRestrictionSpecified = false;
    }

    /**
     * The user's authentication key modification date.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected Long timestampKey;

    public Long getTimestampKey() {
        return timestampKey;
    }

    public void setTimestampKey(Long timestampKey) {
        timestampKeySpecified = true;
        this.timestampKey = timestampKey;
    }

    protected boolean timestampKeySpecified;

    public boolean isTimestampKeySpecified() {
        return timestampKeySpecified;
    }

    public void unsetTimestampKey() {
        timestampKey = null;
        timestampKeySpecified = false;
    }

    /**
     * The user's identifying number.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected Long userId;

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        userIdSpecified = true;
        this.userId = userId;
    }

    protected boolean userIdSpecified;

    public boolean isUserIdSpecified() {
        return userIdSpecified;
    }

    public void unsetUserId() {
        userId = null;
        userIdSpecified = false;
    }

    public Service asService(ApiClient client) {
        return service(client, id);
    }

    public static Service service(ApiClient client) {
        return client.createService(Service.class, null);
    }

    public static Service service(ApiClient client, Long id) {
        return client.createService(Service.class, id == null ? null : id.toString());
    }

    /**
     * An account's user may obtain access to SoftLayer's API through this authentication service.
     *
     * @see SoftLayer_User_Customer_ApiAuthentication
     */
    @com.softlayer.api.annotation.ApiService("SoftLayer_User_Customer_ApiAuthentication")
    public static interface Service extends com.softlayer.api.Service {

        public ServiceAsync asAsync();
        public Mask withNewMask();
        public Mask withMask();
        public void setMask(Mask mask);

        /**
         * @see SoftLayer_User_Customer_ApiAuthentication::editObject
         */
        @ApiMethod(instanceRequired = true)
        public ApiAuthentication editObject(ApiAuthentication templateObject);

        /**
         * getObject retrieves the SoftLayer_User_Customer_ApiAuthentication object whose ID number corresponds to the ID number of the init parameter passed to the SoftLayer_User_Customer_ApiAuthentication service. 
         *
         * @see SoftLayer_User_Customer_ApiAuthentication::getObject
         */
        @ApiMethod(instanceRequired = true)
        public ApiAuthentication getObject();

        /**
         * The user who owns the api authentication key.
         *
         * @see SoftLayer_User_Customer_ApiAuthentication::getUser
         */
        @ApiMethod(instanceRequired = true)
        public Customer getUser();

    }

    public static interface ServiceAsync extends com.softlayer.api.ServiceAsync {

        public Mask withNewMask();
        public Mask withMask();
        public void setMask(Mask mask);

        /**
         * Async version of {@link Service#editObject}
         */
        public Future editObject(ApiAuthentication templateObject);

        public Future editObject(ApiAuthentication templateObject, ResponseHandler callback);

        /**
         * Async version of {@link Service#getObject}
         */
        public Future getObject();

        public Future getObject(ResponseHandler callback);

        /**
         * Async version of {@link Service#getUser}
         */
        public Future getUser();

        /**
         * Async callback version of {@link Service#getUser}
         */
        public Future getUser(ResponseHandler callback);

    }

    public static class Mask extends com.softlayer.api.service.Entity.Mask {

        public com.softlayer.api.service.user.Customer.Mask user() {
            return withSubMask("user", com.softlayer.api.service.user.Customer.Mask.class);
        }

        public Mask authenticationKey() {
            withLocalProperty("authenticationKey");
            return this;
        }

        public Mask id() {
            withLocalProperty("id");
            return this;
        }

        public Mask ipAddressRestriction() {
            withLocalProperty("ipAddressRestriction");
            return this;
        }

        public Mask timestampKey() {
            withLocalProperty("timestampKey");
            return this;
        }

        public Mask userId() {
            withLocalProperty("userId");
            return this;
        }

    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy