Create email interaction
Create a new email interaction
@param createData Request parameters. (optional)
@return ApiResponse&lt;ApiSuccessResponse&gt;
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
544299
public ApiResponse<ApiSuccessResponse> createEmailWithHttpInfo(CreateData createData) throws ApiException {
        com.squareup.okhttp.Call call = createEmailValidateBeforeCall(createData, null, null);
        Type localVarReturnType = new TypeToken<ApiSuccessResponse>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }
86647
public ApiSuccessResponse createContact(CreateContactData createContactData) throws ApiException {
        ApiResponse<ApiSuccessResponse> resp = createContactWithHttpInfo(createContactData);
        return resp.getData();
    }
762756
public ApiResponse<Void> connectWithHttpInfo() throws ApiException {
        com.squareup.okhttp.Call call = connectValidateBeforeCall(null, null);
        return apiClient.execute(call);
    }
58973
@Override
    public TDClient withApiKey(String newApiKey)
    {
        return new TDClient(config, httpClient, Optional.of(newApiKey));
    }
866026
@POST
    @Path("create")
    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
    public Response createFromBasicAuth() throws Exception {
        return doCreateFromBasicAuth(null);
    }
948488
public ApiSuccessResponse makeCall(MakeCallData makeCallData) throws ApiException {
        ApiResponse<ApiSuccessResponse> resp = makeCallWithHttpInfo(makeCallData);
        return resp.getData();
    }
507402
@PostMapping(value = "/v1/tickets", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    public ResponseEntity<String> createTicketGrantingTicket(@RequestBody(required=false) final MultiValueMap<String, String> requestBody,
                                                             final HttpServletRequest request) {
        try {
            val tgtId = createTicketGrantingTicketForRequest(requestBody, request);
            return createResponseEntityForTicket(request, tgtId);
        } catch (final AuthenticationException e) {
            return RestResourceUtils.createResponseEntityForAuthnFailure(e, request, applicationContext);
        } catch (final BadRestRequestException e) {
            LOGGER.error(e.getMessage(), e);
            return new ResponseEntity<>(e.getMessage(), HttpStatus.BAD_REQUEST);
        } catch (final Exception e) {
            LOGGER.error(e.getMessage(), e);
            return new ResponseEntity<>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
        }
    }
1019164
public Response makeRequest(final Request request) {

        HttpMethod method = request.getMethod();
        RequestBuilder builder = RequestBuilder.create(method.toString())
            .setUri(request.constructURL().toString())
            .setVersion(HttpVersion.HTTP_1_1)
            .setCharset(StandardCharsets.UTF_8);

        if (request.requiresAuthentication()) {
            builder.addHeader(HttpHeaders.AUTHORIZATION, request.getAuthString());
        }

        if (method == HttpMethod.POST) {
            builder.addHeader(HttpHeaders.CONTENT_TYPE, "application/x-www-form-urlencoded");

            for (Map.Entry<String, List<String>> entry : request.getPostParams().entrySet()) {
                for (String value : entry.getValue()) {
                    builder.addParameter(entry.getKey(), value);
                }
            }
        }

        HttpResponse response = null;

        try {
            response = client.execute(builder.build());
            HttpEntity entity = response.getEntity();
            return new Response(
                // Consume the entire HTTP response before returning the stream
                entity == null ? null : new BufferedHttpEntity(entity).getContent(),
                response.getStatusLine().getStatusCode()
            );
        } catch (IOException e) {
            throw new ApiException(e.getMessage(), e);
        } finally {

            // Ensure this response is properly closed
            HttpClientUtils.closeQuietly(response);

        }

    }
503888
public CreateResponse create() throws IOException, PlivoRestException {
    validate();
    Response<CreateResponse> response = obtainCall().execute();

    handleResponse(response);

    return response.body();
  }
532556
public function create(array $data)
    {
        $model = $this->app->make($this->model());
        $model->fill($data);

        $wasSaved = $model->save();

        if ($wasSaved) {
            return $this->find($model->id);
        }

        $errorMessage = "Não foi possível salvar.";

        if (method_exists($model, 'isValid')) {
            $exception = new ValidationException();
            $exception->setMessages($model->getValidationErrors()->all());

            throw $exception;
        }
        throw new ApiException($errorMessage);

    }
1253423
public void put(String data,Charset charset) throws APIException {
        HttpResponse response = client.put(getUrl(), new StringEntity(data, charset));
        HttpClientHelpers.throwIfNotOk(response);
    }
848809
public Connection<S> createConnection(ConnectionData data) {
		return new OAuth2Connection<S>(data, getOAuth2ServiceProvider(), getApiAdapter());
	}
206554
public static function create(
        int $statusCode,
        string $message,
        string $request,
        string $response
    ): ApiClientException {
        switch ($statusCode) {
            case 400:
                $exception = new BadRequestException($message, $request, $response);
                break;
            case 401:
                $exception = new UnauthorizedException($message, $request, $response);
                break;
            case 403:
                $exception = new ForbiddenException($message, $request, $response);
                break;
            case 404:
                $exception = new NotFoundException($message, $request, $response);
                break;
            default:
                $exception = new ApiClientException($message, $statusCode, $request, $response);
                break;
        }
        return $exception;
    }
558677
public function createObjectState(
        ?ObjectStateCreateData $data = null,
        ?string $name = null
    ): FormInterface {
        $name = $name ?: StringUtil::fqcnToBlockPrefix(ObjectStateCreateType::class);

        return $this->formFactory->createNamed(
            $name,
            ObjectStateCreateType::class,
            $data ?? new ObjectStateCreateData()
        );
    }
1349707
def recipient_address_create(self, data, **kwargs):
        ""
        api_path = "/api/v2/recipient_addresses.json"
        return self.call(api_path, method="POST", data=data, **kwargs)
998509
public CreatePresetResponse createPreset(CreatePresetRequest request) {
        checkNotNull(request, "The parameter request should NOT be null.");
        
        InternalRequest internalRequest = createRequest(HttpMethodName.POST, request, PRESET);

        return invokeHttpClient(internalRequest, CreatePresetResponse.class);
    }
1003585
public function create($listId, Contact $contact, $action=Contact::ACTION_ADDFORCE)
    {
        $contact->setAction($action);
        $response = $this->_exec($listId, $contact);
        if (!$response->success()) {
            $this->throwError("ContactsListManager:create() failed", $response);
        }

        return $response->getData();
    }