MyPureCloud / terraform-provider-genesyscloud

Terraform Provider Genesyscloud
MIT License
37 stars 84 forks source link

resource genesyscloud_routing_queue - subTypeSettings in media settings & cannedResponseLibraries #1149

Open TaisukChoi opened 4 months ago

TaisukChoi commented 4 months ago

Right now, routing_queue does not have subTypeSettings in mediasettings* and cannedResponseLibraries.

Not having subTypeSettings in media_settings_message makes enable_auto_answer useless as auto answer does not turn on for media subtypes.

Not supporting cannedResponseLibraries is bit more problematic, because when you update a queue with canned response library configured using Terraform, canned response library setting goes back to "All libraries". As a result once you configure canned response libraries to queues CXasCode can no longer be used to manage queue configuration. I understand this can take longer to fix as Go SDK does not support this either.

I was thinking to add below to genesyscloud/routing_queue/resource_genesyscloud_routing_queue_schema.go and modify queue to work with but not too sure how long it will take.

`
// New subschema

queueMediaBaseSettingsResource = &schema.Resource{
    Schema: map[string]*schema.Schema{
        "media_subtype": {
            Description: "Media subtype, examples are whatsapp, twitter, webmessaging, facebook, sms, instagram & open",
            Type:        schema.TypeString,
            Required:    true,
        },
        "enable_auto_answer": {
            Description: "Indicates if auto-answer is enabled for the given media type or subtype (default is false).  Subtype settings take precedence over media type settings.",
            Type:        schema.TypeBool,
            Required:    true,
        },
    },
}

// Add "subtype_settings to queueMediaSettingsResource
    queueMediaSettingsResource = &schema.Resource{
    Schema: map[string]*schema.Schema{
        <.........>
        "subtype_settings": {
            Description: "Media subtype specific settings.",
            Type:        schema.TypeList,
            Optional:    true,
            Elem:        queueMediaBaseSettingsResource,
        },
    },
}

`