All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.opsmatters.newrelic.api.services.BaseFluent Maven / Gradle / Ivy

/*
 * Copyright 2018 Gerald Curley
 *
 * Licensed 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 com.opsmatters.newrelic.api.services;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Collection;
import java.util.logging.Logger;
import javax.ws.rs.core.GenericType;
import com.opsmatters.newrelic.api.NewRelicClient;
import com.opsmatters.newrelic.api.model.alerts.AlertIncident;
import com.opsmatters.newrelic.api.model.alerts.AlertViolation;
import com.opsmatters.newrelic.api.model.alerts.AlertEvent;
import com.opsmatters.newrelic.api.model.alerts.policies.AlertPolicy;
import com.opsmatters.newrelic.api.model.alerts.policies.AlertPolicyChannel;
import com.opsmatters.newrelic.api.model.alerts.channels.AlertChannel;
import com.opsmatters.newrelic.api.model.alerts.conditions.AlertCondition;
import com.opsmatters.newrelic.api.model.alerts.conditions.NrqlAlertCondition;
import com.opsmatters.newrelic.api.model.alerts.conditions.ExternalServiceAlertCondition;
import com.opsmatters.newrelic.api.model.alerts.conditions.PluginsAlertCondition;
import com.opsmatters.newrelic.api.model.alerts.conditions.SyntheticsAlertCondition;
import com.opsmatters.newrelic.api.model.alerts.conditions.InfraAlertCondition;
import com.opsmatters.newrelic.api.model.applications.Application;
import com.opsmatters.newrelic.api.model.applications.ApplicationHost;
import com.opsmatters.newrelic.api.model.applications.ApplicationInstance;
import com.opsmatters.newrelic.api.model.applications.BrowserApplication;
import com.opsmatters.newrelic.api.model.applications.MobileApplication;
import com.opsmatters.newrelic.api.model.transactions.KeyTransaction;
import com.opsmatters.newrelic.api.model.plugins.Plugin;
import com.opsmatters.newrelic.api.model.plugins.PluginComponent;
import com.opsmatters.newrelic.api.model.servers.Server;
import com.opsmatters.newrelic.api.model.metrics.Metric;
import com.opsmatters.newrelic.api.model.metrics.MetricData;
import com.opsmatters.newrelic.api.model.deployments.Deployment;
import com.opsmatters.newrelic.api.model.labels.Label;
import com.opsmatters.newrelic.api.model.accounts.PartnerAccount;
import com.opsmatters.newrelic.api.model.accounts.PartnerUser;
import com.opsmatters.newrelic.api.model.accounts.PartnerSubscription;
import com.opsmatters.newrelic.api.model.accounts.User;
import com.opsmatters.newrelic.api.model.accounts.UsageData;
import com.opsmatters.newrelic.api.model.synthetics.Monitor;
import com.opsmatters.newrelic.api.model.synthetics.Script;
import com.opsmatters.newrelic.api.model.synthetics.Location;
import com.opsmatters.newrelic.api.model.insights.QueryData;
import com.opsmatters.newrelic.api.model.Status;
import com.opsmatters.newrelic.api.model.insights.Dashboard;

/**
 * Provides the types and HTTP operations to be used with the API calls.  
 * 
 * @author Gerald Curley (opsmatters)
 */
public class BaseFluent
{
    private static final Logger logger = Logger.getLogger(BaseFluent.class.getName());

    protected static final GenericType ALERT_POLICY = new GenericType(){};
    protected static final GenericType> ALERT_POLICIES = new GenericType>(){};

    protected static final GenericType ALERT_CHANNEL = new GenericType(){};
    protected static final GenericType> ALERT_CHANNELS = new GenericType>(){};

    protected static final GenericType ALERT_POLICY_CHANNEL = new GenericType(){};

    protected static final GenericType ALERT_CONDITION = new GenericType(){};
    protected static final GenericType> ALERT_CONDITIONS = new GenericType>(){};

    protected static final GenericType NRQL_ALERT_CONDITION = new GenericType(){};
    protected static final GenericType> NRQL_ALERT_CONDITIONS = new GenericType>(){};

    protected static final GenericType EXTERNAL_SERVICE_ALERT_CONDITION = new GenericType(){};
    protected static final GenericType> EXTERNAL_SERVICE_ALERT_CONDITIONS = new GenericType>(){};

    protected static final GenericType PLUGINS_ALERT_CONDITION = new GenericType(){};
    protected static final GenericType> PLUGINS_ALERT_CONDITIONS = new GenericType>(){};

    protected static final GenericType SYNTHETICS_ALERT_CONDITION = new GenericType(){};
    protected static final GenericType> SYNTHETICS_ALERT_CONDITIONS = new GenericType>(){};

    protected static final GenericType INFRA_ALERT_CONDITION = new GenericType(){};
    protected static final GenericType> INFRA_ALERT_CONDITIONS = new GenericType>(){};

    protected static final GenericType ALERT_INCIDENT = new GenericType(){};
    protected static final GenericType> ALERT_INCIDENTS = new GenericType>(){};

    protected static final GenericType ALERT_VIOLATION = new GenericType(){};
    protected static final GenericType> ALERT_VIOLATIONS = new GenericType>(){};

    protected static final GenericType ALERT_EVENT = new GenericType(){};
    protected static final GenericType> ALERT_EVENTS = new GenericType>(){};

    protected static final GenericType APPLICATION = new GenericType(){};
    protected static final GenericType> APPLICATIONS = new GenericType>(){};

    protected static final GenericType APPLICATION_HOST = new GenericType(){};
    protected static final GenericType> APPLICATION_HOSTS = new GenericType>(){};

    protected static final GenericType APPLICATION_INSTANCE = new GenericType(){};
    protected static final GenericType> APPLICATION_INSTANCES = new GenericType>(){};

    protected static final GenericType BROWSER_APPLICATION = new GenericType(){};
    protected static final GenericType> BROWSER_APPLICATIONS = new GenericType>(){};

    protected static final GenericType MOBILE_APPLICATION = new GenericType(){};
    protected static final GenericType> MOBILE_APPLICATIONS = new GenericType>(){};

    protected static final GenericType KEY_TRANSACTION = new GenericType(){};
    protected static final GenericType> KEY_TRANSACTIONS = new GenericType>(){};

    protected static final GenericType PLUGIN = new GenericType(){};
    protected static final GenericType> PLUGINS = new GenericType>(){};

    protected static final GenericType PLUGIN_COMPONENT = new GenericType(){};
    protected static final GenericType> PLUGIN_COMPONENTS = new GenericType>(){};

    protected static final GenericType SERVER = new GenericType(){};
    protected static final GenericType> SERVERS = new GenericType>(){};

    protected static final GenericType> METRICS = new GenericType>(){};
    protected static final GenericType METRIC_DATA = new GenericType(){};

    protected static final GenericType DEPLOYMENT = new GenericType(){};
    protected static final GenericType> DEPLOYMENTS = new GenericType>(){};

    protected static final GenericType