/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.camel.component.azure.eventgrid.springboot;

import com.azure.core.credential.AzureKeyCredential;
import com.azure.core.credential.TokenCredential;
import com.azure.core.models.CloudEvent;
import com.azure.messaging.eventgrid.EventGridPublisherClient;
import org.apache.camel.component.azure.eventgrid.CredentialType;
import org.apache.camel.component.azure.eventgrid.EventGridComponent;
import org.apache.camel.component.azure.eventgrid.EventGridConfiguration;
import org.apache.camel.spring.boot.ComponentConfigurationPropertiesCommon;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * Send events to Azure Event Grid topics.
 * 
 * Generated by camel-package-maven-plugin - do not edit this file!
 */
@ConfigurationProperties(prefix = "camel.component.azure-eventgrid")
public class EventGridComponentConfiguration
        extends
            ComponentConfigurationPropertiesCommon {

    /**
     * Whether to enable auto configuration of the azure-eventgrid component.
     * This is enabled by default.
     */
    private Boolean enabled;
    /**
     * The component configurations. The option is a
     * org.apache.camel.component.azure.eventgrid.EventGridConfiguration type.
     */
    private EventGridConfiguration configuration;
    /**
     * Whether the producer should be started lazy (on the first message). By
     * starting lazy you can use this to allow CamelContext and routes to
     * startup in situations where a producer may otherwise fail during starting
     * and cause the route to fail being started. By deferring this startup to
     * be lazy then the startup failure can be handled during routing messages
     * via Camel's routing error handlers. Beware that when the first message is
     * processed then creating and starting the producer may take a little time
     * and prolong the total processing time of the processing.
     */
    private Boolean lazyStartProducer = false;
    /**
     * The EventGrid publisher client. If provided, it will be used instead of
     * creating a new one. The option is a
     * com.azure.messaging.eventgrid.EventGridPublisherClient<com.azure.core.models.CloudEvent> type.
     */
    private EventGridPublisherClient<CloudEvent> publisherClient;
    /**
     * Whether autowiring is enabled. This is used for automatic autowiring
     * options (the option must be marked as autowired) by looking up in the
     * registry to find if there is a single instance of matching type, which
     * then gets configured on the component. This can be used for automatic
     * configuring JDBC data sources, JMS connection factories, AWS Clients,
     * etc.
     */
    private Boolean autowiredEnabled = true;
    /**
     * The access key for the Event Grid topic. Required when using ACCESS_KEY
     * credential type.
     */
    private String accessKey;
    /**
     * The Azure Key Credential for authentication. This is automatically
     * created from the accessKey if not provided. The option is a
     * com.azure.core.credential.AzureKeyCredential type.
     */
    private AzureKeyCredential azureKeyCredential;
    /**
     * Determines the credential strategy to adopt
     */
    private CredentialType credentialType = CredentialType.ACCESS_KEY;
    /**
     * Provide custom authentication credentials using an implementation of
     * TokenCredential. The option is a
     * com.azure.core.credential.TokenCredential type.
     */
    private TokenCredential tokenCredential;

    public EventGridConfiguration getConfiguration() {
        return configuration;
    }

    public void setConfiguration(EventGridConfiguration configuration) {
        this.configuration = configuration;
    }

    public Boolean getLazyStartProducer() {
        return lazyStartProducer;
    }

    public void setLazyStartProducer(Boolean lazyStartProducer) {
        this.lazyStartProducer = lazyStartProducer;
    }

    public EventGridPublisherClient<CloudEvent> getPublisherClient() {
        return publisherClient;
    }

    public void setPublisherClient(
            EventGridPublisherClient<CloudEvent> publisherClient) {
        this.publisherClient = publisherClient;
    }

    public Boolean getAutowiredEnabled() {
        return autowiredEnabled;
    }

    public void setAutowiredEnabled(Boolean autowiredEnabled) {
        this.autowiredEnabled = autowiredEnabled;
    }

    public String getAccessKey() {
        return accessKey;
    }

    public void setAccessKey(String accessKey) {
        this.accessKey = accessKey;
    }

    public AzureKeyCredential getAzureKeyCredential() {
        return azureKeyCredential;
    }

    public void setAzureKeyCredential(AzureKeyCredential azureKeyCredential) {
        this.azureKeyCredential = azureKeyCredential;
    }

    public CredentialType getCredentialType() {
        return credentialType;
    }

    public void setCredentialType(CredentialType credentialType) {
        this.credentialType = credentialType;
    }

    public TokenCredential getTokenCredential() {
        return tokenCredential;
    }

    public void setTokenCredential(TokenCredential tokenCredential) {
        this.tokenCredential = tokenCredential;
    }
}