fi.otavanopisto.restfulptv.client.ElectronicChannelsApi Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of restful-ptv-rest-client Show documentation
Show all versions of restful-ptv-rest-client Show documentation
Restful way to use Palvelutietovaranto.
/**
* RESTful PTV
* Restful way to use Palvelutietovaranto.
*
* OpenAPI spec version: v1
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
* 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 fi.otavanopisto.restfulptv.client;
import fi.otavanopisto.restfulptv.client.model.*;
import fi.otavanopisto.restfulptv.client.model.BadRequest;
import fi.otavanopisto.restfulptv.client.model.ElectronicChannel;
import fi.otavanopisto.restfulptv.client.model.Forbidden;
import fi.otavanopisto.restfulptv.client.model.InternalServerError;
import fi.otavanopisto.restfulptv.client.model.NotFound;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@javax.annotation.Generated(value = "class io.swagger.codegen.languages.JavaClientCodegen", date = "2016-10-05T10:47:52.746+03:00")
public class ElectronicChannelsApi {
private ApiClient client;
private String baseUrl;
public ElectronicChannelsApi(String baseUrl, ApiClient client) {
this.client = client;
this.baseUrl = baseUrl;
}
/**
* creates ElectronicChannel
* creates ElectronicChannel
* @param serviceId service id (required)
* @param body Payload (required)
*/
public ApiResponse createServiceElectronicChannel(String serviceId, ElectronicChannel body) {
Map queryParams = new HashMap<>();
Map formParams = new HashMap<>();
String path = String.format("%s/services/{serviceId}/electronicChannels"
.replaceAll("\\{" + "serviceId" + "\\}", String.valueOf(serviceId)), baseUrl);
ResultType resultType = new ResultType() {};
return client.doPOSTRequest(path, resultType, queryParams, formParams);
}
/**
* finds ElectronicChannel by electronicChannelId
* finds ElectronicChannels by electronicChannelId
* @param serviceId Service id (required)
* @param electronicChannelId electronicChannel id (required)
*/
public ApiResponse findServiceElectronicChannel(String serviceId, String electronicChannelId) {
Map queryParams = new HashMap<>();
Map formParams = new HashMap<>();
String path = String.format("%s/services/{serviceId}/electronicChannels/{electronicChannelId}"
.replaceAll("\\{" + "serviceId" + "\\}", String.valueOf(serviceId))
.replaceAll("\\{" + "electronicChannelId" + "\\}", String.valueOf(electronicChannelId)), baseUrl);
ResultType resultType = new ResultType() {};
return client.doGETRequest(path, resultType, queryParams, formParams);
}
/**
* Lists ElectronicChannels by serviceId
* Lists ElectronicChannels by serviceId
* @param serviceId Service id (required)
* @param firstResult First result (optional)
* @param maxResults Max results (optional)
*/
public ApiResponse> listServiceElectronicChannels(String serviceId, Long firstResult, Long maxResults) {
Map queryParams = new HashMap<>();
Map formParams = new HashMap<>();
if (firstResult != null)
queryParams.put("firstResult", firstResult);
if (maxResults != null)
queryParams.put("maxResults", maxResults);
String path = String.format("%s/services/{serviceId}/electronicChannels"
.replaceAll("\\{" + "serviceId" + "\\}", String.valueOf(serviceId)), baseUrl);
ResultType> resultType = new ResultType>() {};
return client.doGETRequest(path, resultType, queryParams, formParams);
}
/**
* Updates ElectronicChannel
* Updates ElectronicChannel
* @param serviceId service id (required)
* @param electronicChannelId electronicChannel id (required)
* @param body Payload (required)
*/
public ApiResponse updateServiceElectronicChannel(String serviceId, String electronicChannelId, ElectronicChannel body) {
Map queryParams = new HashMap<>();
Map formParams = new HashMap<>();
String path = String.format("%s/services/{serviceId}/electronicChannels/{electronicChannelId}"
.replaceAll("\\{" + "serviceId" + "\\}", String.valueOf(serviceId))
.replaceAll("\\{" + "electronicChannelId" + "\\}", String.valueOf(electronicChannelId)), baseUrl);
ResultType resultType = new ResultType() {};
return client.doPUTRequest(path, resultType, queryParams, formParams);
}
}