Class CustomRegistryCredentials
java.lang.Object
com.azure.resourcemanager.containerregistry.models.CustomRegistryCredentials
- All Implemented Interfaces:
com.azure.json.JsonSerializable<CustomRegistryCredentials>
public final class CustomRegistryCredentials
extends Object
implements com.azure.json.JsonSerializable<CustomRegistryCredentials>
Describes the credentials that will be used to access a custom registry during a run.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of CustomRegistryCredentials class. -
Method Summary
Modifier and TypeMethodDescriptionstatic CustomRegistryCredentialsfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of CustomRegistryCredentials from the JsonReader.identity()Get the identity property: Indicates the managed identity assigned to the custom credential.password()Get the password property: The password for logging into the custom registry.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) username()Get the username property: The username for logging into the custom registry.voidvalidate()Validates the instance.withIdentity(String identity) Set the identity property: Indicates the managed identity assigned to the custom credential.withPassword(SecretObject password) Set the password property: The password for logging into the custom registry.withUsername(SecretObject username) Set the username property: The username for logging into the custom registry.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
CustomRegistryCredentials
public CustomRegistryCredentials()Creates an instance of CustomRegistryCredentials class.
-
-
Method Details
-
username
Get the username property: The username for logging into the custom registry.- Returns:
- the username value.
-
withUsername
Set the username property: The username for logging into the custom registry.- Parameters:
username- the username value to set.- Returns:
- the CustomRegistryCredentials object itself.
-
password
Get the password property: The password for logging into the custom registry. The password is a secret object that allows multiple ways of providing the value for it.- Returns:
- the password value.
-
withPassword
Set the password property: The password for logging into the custom registry. The password is a secret object that allows multiple ways of providing the value for it.- Parameters:
password- the password value to set.- Returns:
- the CustomRegistryCredentials object itself.
-
identity
Get the identity property: Indicates the managed identity assigned to the custom credential. If a user-assigned identity this value is the Client ID. If a system-assigned identity, the value will be `system`. In the case of a system-assigned identity, the Client ID will be determined by the runner. This identity may be used to authenticate to key vault to retrieve credentials or it may be the only source of authentication used for accessing the registry.- Returns:
- the identity value.
-
withIdentity
Set the identity property: Indicates the managed identity assigned to the custom credential. If a user-assigned identity this value is the Client ID. If a system-assigned identity, the value will be `system`. In the case of a system-assigned identity, the Client ID will be determined by the runner. This identity may be used to authenticate to key vault to retrieve credentials or it may be the only source of authentication used for accessing the registry.- Parameters:
identity- the identity value to set.- Returns:
- the CustomRegistryCredentials object itself.
-
validate
public void validate()Validates the instance.- Throws:
IllegalArgumentException- thrown if the instance is not valid.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<CustomRegistryCredentials>- Throws:
IOException
-
fromJson
public static CustomRegistryCredentials fromJson(com.azure.json.JsonReader jsonReader) throws IOException Reads an instance of CustomRegistryCredentials from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of CustomRegistryCredentials if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
- Throws:
IOException- If an error occurs while reading the CustomRegistryCredentials.
-