src/wiotp/sdk/api/services/__init__.py
def create(self, serviceBinding):
        """
        Create a new external service. 
        The service must include all of the details required to connect 
        and authenticate to the external service in the credentials property. 
        Parameters:
            - serviceName (string) - Name of the service
            - serviceType (string) - must be either eventstreams or cloudant
            - credentials (json object) - Should have a valid structure for the service type.
            - description (string) - description of the service
        Throws APIException on failure
        """
        if not isinstance(serviceBinding, ServiceBindingCreateRequest):
            if serviceBinding["type"] == "cloudant":
                serviceBinding = CloudantServiceBindingCreateRequest(**serviceBinding)
            elif serviceBinding["type"] == "eventstreams":
                serviceBinding = EventStreamsServiceBindingCreateRequest(**serviceBinding)
            else:
                raise Exception("Unsupported service binding type")

        url = "api/v0002/s2s/services"

        r = self._apiClient.post(url, data=serviceBinding)
        if r.status_code == 201:
            return ServiceBinding(**r.json())
        else:
            raise ApiException(r)
def create(self, serviceBinding):
        """
        Create a new external service. 
        The service must include all of the details required to connect 
        and authenticate to the external service in the credentials property. 
        Parameters:
            - serviceName (string) - Name of the service
            - serviceType (string) - must be either eventstreams or cloudant
            - credentials (json object) - Should have a valid structure for the service type.
            - description (string) - description of the service
        Throws APIException on failure
        """
        if not isinstance(serviceBinding, ServiceBindingCreateRequest):
            if serviceBinding["type"] == "cloudant":
                serviceBinding = CloudantServiceBindingCreateRequest(**serviceBinding)
            elif serviceBinding["type"] == "eventstreams":
                serviceBinding = EventStreamsServiceBindingCreateRequest(**serviceBinding)
            else:
                raise Exception("Unsupported service binding type")

        url = "api/v0002/s2s/services"

        r = self._apiClient.post(url, data=serviceBinding)
        if r.status_code == 201:
            return ServiceBinding(**r.json())
        else:
            raise ApiException(r)
Create a new external service. 
        The service must include all of the details required to connect 
        and authenticate to the external service in the credentials property. 
        Parameters:
            - serviceName (string) - Name of the service
            - serviceType (string) - must be either eventstreams or cloudant
            - credentials (json object) - Should have a valid structure for the service type.
            - description (string) - description of the service
        Throws APIException on failure