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

com.spotinst.sdkjava.model.SpotinstSpectrumRepo Maven / Gradle / Ivy

There is a newer version: 1.0.121
Show newest version
package com.spotinst.sdkjava.model;

import com.spotinst.sdkjava.exception.ExceptionHelper;
import com.spotinst.sdkjava.exception.SpotinstHttpException;

class SpotinstSpectrumRepo implements ISpotinstSpectrumRepo {

  @Override
  public RepoGenericResponse create(SpectrumMetricDataRequest metricDataRequest, String authToken, String account) {
    RepoGenericResponse retVal;
    try {
      Boolean result = SpotinstSpectrumService.publishMetricData(metricDataRequest, authToken, account);
      if (result) {
        retVal = new RepoGenericResponse<>(true);
      } else {
        retVal = new RepoGenericResponse<>(false);
      }
    } catch (SpotinstHttpException ex) {
      retVal = ExceptionHelper.handleHttpException(ex);
    }

    return retVal;
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy