# coding=utf-8
# *** WARNING: this file was generated by pulumigen. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from ._enums import *

__all__ = ['RegistryCredentialArgs', 'RegistryCredential']

@pulumi.input_type
class RegistryCredentialArgs:
    def __init__(__self__, *,
                 auth_token: pulumi.Input[str],
                 owner_id: pulumi.Input[str],
                 registry: pulumi.Input['Registry'],
                 username: pulumi.Input[str],
                 name: Optional[pulumi.Input[str]] = None):
        """
        The set of arguments for constructing a RegistryCredential resource.
        :param pulumi.Input['Registry'] registry: The registry to use this credential with
        """
        pulumi.set(__self__, "auth_token", auth_token)
        pulumi.set(__self__, "owner_id", owner_id)
        pulumi.set(__self__, "registry", registry)
        pulumi.set(__self__, "username", username)
        if name is not None:
            pulumi.set(__self__, "name", name)

    @property
    @pulumi.getter(name="authToken")
    def auth_token(self) -> pulumi.Input[str]:
        return pulumi.get(self, "auth_token")

    @auth_token.setter
    def auth_token(self, value: pulumi.Input[str]):
        pulumi.set(self, "auth_token", value)

    @property
    @pulumi.getter(name="ownerId")
    def owner_id(self) -> pulumi.Input[str]:
        return pulumi.get(self, "owner_id")

    @owner_id.setter
    def owner_id(self, value: pulumi.Input[str]):
        pulumi.set(self, "owner_id", value)

    @property
    @pulumi.getter
    def registry(self) -> pulumi.Input['Registry']:
        """
        The registry to use this credential with
        """
        return pulumi.get(self, "registry")

    @registry.setter
    def registry(self, value: pulumi.Input['Registry']):
        pulumi.set(self, "registry", value)

    @property
    @pulumi.getter
    def username(self) -> pulumi.Input[str]:
        return pulumi.get(self, "username")

    @username.setter
    def username(self, value: pulumi.Input[str]):
        pulumi.set(self, "username", value)

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "name")

    @name.setter
    def name(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "name", value)


class RegistryCredential(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 auth_token: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 owner_id: Optional[pulumi.Input[str]] = None,
                 registry: Optional[pulumi.Input['Registry']] = None,
                 username: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        """
        Create a RegistryCredential resource with the given unique name, props, and options.
        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input['Registry'] registry: The registry to use this credential with
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: RegistryCredentialArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Create a RegistryCredential resource with the given unique name, props, and options.
        :param str resource_name: The name of the resource.
        :param RegistryCredentialArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(RegistryCredentialArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 auth_token: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 owner_id: Optional[pulumi.Input[str]] = None,
                 registry: Optional[pulumi.Input['Registry']] = None,
                 username: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = RegistryCredentialArgs.__new__(RegistryCredentialArgs)

            if auth_token is None and not opts.urn:
                raise TypeError("Missing required property 'auth_token'")
            __props__.__dict__["auth_token"] = auth_token
            __props__.__dict__["name"] = name
            if owner_id is None and not opts.urn:
                raise TypeError("Missing required property 'owner_id'")
            __props__.__dict__["owner_id"] = owner_id
            if registry is None and not opts.urn:
                raise TypeError("Missing required property 'registry'")
            __props__.__dict__["registry"] = registry
            if username is None and not opts.urn:
                raise TypeError("Missing required property 'username'")
            __props__.__dict__["username"] = username
        super(RegistryCredential, __self__).__init__(
            'render:registrycredentials:RegistryCredential',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None) -> 'RegistryCredential':
        """
        Get an existing RegistryCredential resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = RegistryCredentialArgs.__new__(RegistryCredentialArgs)

        __props__.__dict__["auth_token"] = None
        __props__.__dict__["name"] = None
        __props__.__dict__["owner_id"] = None
        __props__.__dict__["registry"] = None
        __props__.__dict__["username"] = None
        return RegistryCredential(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="authToken")
    def auth_token(self) -> pulumi.Output[str]:
        return pulumi.get(self, "auth_token")

    @property
    @pulumi.getter
    def name(self) -> pulumi.Output[str]:
        """
        Descriptive name for this credential
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter(name="ownerId")
    def owner_id(self) -> pulumi.Output[str]:
        return pulumi.get(self, "owner_id")

    @property
    @pulumi.getter
    def registry(self) -> pulumi.Output['Registry']:
        """
        The registry to use this credential with
        """
        return pulumi.get(self, "registry")

    @property
    @pulumi.getter
    def username(self) -> pulumi.Output[str]:
        """
        The username associated with the credential
        """
        return pulumi.get(self, "username")

