// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Threading.Tasks;
using Pulumi.Serialization;
using Pulumi;

namespace Pulumiverse.Vra.Securitygroup
{
    public static class GetSecurityGroup
    {
        /// <summary>
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// ### S
        /// This is an example of how to lookup security groups.
        /// 
        /// **Security groups by filter query:**
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using Vra = Pulumi.Vra;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var @this = Vra.Securitygroup.GetSecurityGroup.Invoke(new()
        ///     {
        ///         Filter = $"name eq '{@var.Name}'",
        ///     });
        /// 
        /// });
        /// ```
        /// 
        /// A Security group supports the following arguments:
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Task<GetSecurityGroupResult> InvokeAsync(GetSecurityGroupArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.InvokeAsync<GetSecurityGroupResult>("vra:securitygroup/getSecurityGroup:getSecurityGroup", args ?? new GetSecurityGroupArgs(), options.WithDefaults());

        /// <summary>
        /// {{% examples %}}
        /// ## Example Usage
        /// {{% example %}}
        /// ### S
        /// This is an example of how to lookup security groups.
        /// 
        /// **Security groups by filter query:**
        /// 
        /// ```csharp
        /// using System.Collections.Generic;
        /// using Pulumi;
        /// using Vra = Pulumi.Vra;
        /// 
        /// return await Deployment.RunAsync(() =&gt; 
        /// {
        ///     var @this = Vra.Securitygroup.GetSecurityGroup.Invoke(new()
        ///     {
        ///         Filter = $"name eq '{@var.Name}'",
        ///     });
        /// 
        /// });
        /// ```
        /// 
        /// A Security group supports the following arguments:
        /// {{% /example %}}
        /// {{% /examples %}}
        /// </summary>
        public static Output<GetSecurityGroupResult> Invoke(GetSecurityGroupInvokeArgs args, InvokeOptions? options = null)
            => Pulumi.Deployment.Instance.Invoke<GetSecurityGroupResult>("vra:securitygroup/getSecurityGroup:getSecurityGroup", args ?? new GetSecurityGroupInvokeArgs(), options.WithDefaults());
    }


    public sealed class GetSecurityGroupArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Search criteria to narrow down the Security groups.
        /// </summary>
        [Input("filter", required: true)]
        public string Filter { get; set; } = null!;

        [Input("rules")]
        private List<Inputs.GetSecurityGroupRuleArgs>? _rules;

        /// <summary>
        /// List of security rules.
        /// </summary>
        public List<Inputs.GetSecurityGroupRuleArgs> Rules
        {
            get => _rules ?? (_rules = new List<Inputs.GetSecurityGroupRuleArgs>());
            set => _rules = value;
        }

        public GetSecurityGroupArgs()
        {
        }
        public static new GetSecurityGroupArgs Empty => new GetSecurityGroupArgs();
    }

    public sealed class GetSecurityGroupInvokeArgs : global::Pulumi.InvokeArgs
    {
        /// <summary>
        /// Search criteria to narrow down the Security groups.
        /// </summary>
        [Input("filter", required: true)]
        public Input<string> Filter { get; set; } = null!;

        [Input("rules")]
        private InputList<Inputs.GetSecurityGroupRuleInputArgs>? _rules;

        /// <summary>
        /// List of security rules.
        /// </summary>
        public InputList<Inputs.GetSecurityGroupRuleInputArgs> Rules
        {
            get => _rules ?? (_rules = new InputList<Inputs.GetSecurityGroupRuleInputArgs>());
            set => _rules = value;
        }

        public GetSecurityGroupInvokeArgs()
        {
        }
        public static new GetSecurityGroupInvokeArgs Empty => new GetSecurityGroupInvokeArgs();
    }


    [OutputType]
    public sealed class GetSecurityGroupResult
    {
        /// <summary>
        /// Date when the entity was created. The date is in ISO 6801 and UTC.
        /// </summary>
        public readonly string CreatedAt;
        /// <summary>
        /// A human-friendly description of the security groups.
        /// </summary>
        public readonly string Description;
        /// <summary>
        /// External entity Id on the provider side.
        /// </summary>
        public readonly string ExternalId;
        /// <summary>
        /// The id of the region for which this entity is defined.
        /// </summary>
        public readonly string ExternalRegionId;
        public readonly string Filter;
        /// <summary>
        /// ID of the security group.
        /// </summary>
        public readonly string Id;
        /// <summary>
        /// HATEOAS of the entity
        /// </summary>
        public readonly ImmutableArray<Outputs.GetSecurityGroupLinkResult> Links;
        /// <summary>
        /// Name of the security group.
        /// </summary>
        public readonly string Name;
        /// <summary>
        /// ID of organization that entity belongs to.
        /// </summary>
        public readonly string OrganizationId;
        public readonly string Owner;
        /// <summary>
        /// List of security rules.
        /// </summary>
        public readonly ImmutableArray<Outputs.GetSecurityGroupRuleResult> Rules;
        /// <summary>
        /// Date when the entity was last updated. The date is ISO 8601 and UTC.
        /// </summary>
        public readonly string UpdatedAt;

        [OutputConstructor]
        private GetSecurityGroupResult(
            string createdAt,

            string description,

            string externalId,

            string externalRegionId,

            string filter,

            string id,

            ImmutableArray<Outputs.GetSecurityGroupLinkResult> links,

            string name,

            string organizationId,

            string owner,

            ImmutableArray<Outputs.GetSecurityGroupRuleResult> rules,

            string updatedAt)
        {
            CreatedAt = createdAt;
            Description = description;
            ExternalId = externalId;
            ExternalRegionId = externalRegionId;
            Filter = filter;
            Id = id;
            Links = links;
            Name = name;
            OrganizationId = organizationId;
            Owner = owner;
            Rules = rules;
            UpdatedAt = updatedAt;
        }
    }
}
