Creates an image list.

@param contentType The content type.
@param bodyParameter Schema of the body.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the ImageList object
553833
public Observable<ServiceResponse<ImageList>> createWithServiceResponseAsync(String contentType, BodyModel bodyParameter) {
        if (this.client.baseUrl() == null) {
            throw new IllegalArgumentException("Parameter this.client.baseUrl() is required and cannot be null.");
        }
        if (contentType == null) {
            throw new IllegalArgumentException("Parameter contentType is required and cannot be null.");
        }
        if (bodyParameter == null) {
            throw new IllegalArgumentException("Parameter bodyParameter is required and cannot be null.");
        }
        Validator.validate(bodyParameter);
        String parameterizedHost = Joiner.on(", ").join("{baseUrl}", this.client.baseUrl());
        return service.create(contentType, bodyParameter, this.client.acceptLanguage(), parameterizedHost, this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ImageList>>>() {
                @Override
                public Observable<ServiceResponse<ImageList>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<ImageList> clientResponse = createDelegate(response);
                        return Observable.just(clientResponse);
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }
1467
@Override
    public InsertTrans insert(List<Image> imageList, Map<String, String> customParams) {
        return dataOperations.insert(imageList, customParams);
    }
1373377
private void setMultipart(String contentType) {
        String[] dataBoundary = HttpPostRequestDecoder.getMultipartDataBoundary(contentType);
        if (dataBoundary != null) {
            multipartDataBoundary = dataBoundary[0];
            if (dataBoundary.length > 1 && dataBoundary[1] != null) {
                charset = Charset.forName(dataBoundary[1]);
            }
        } else {
            multipartDataBoundary = null;
        }
        currentStatus = MultiPartStatus.HEADERDELIMITER;
    }
1109123
public NodeTypeIterator registerNodeTypes(InputStream xml, int alreadyExistsBehaviour, String contentType)
      throws RepositoryException
   {
      Collection<NodeTypeData> nts = typesManager.registerNodeTypes(xml, alreadyExistsBehaviour, contentType);
      EntityCollection types = new EntityCollection();
      for (NodeTypeData ntdata : nts)
      {
         types.add(new NodeTypeImpl(ntdata, typesManager, this, locationFactory, valueFactory, dataManager));
      }
      return types;
   }
635825
public Observable<TermList> createAsync(String contentType, BodyModel bodyParameter) {
        return createWithServiceResponseAsync(contentType, bodyParameter).map(new Func1<ServiceResponse<TermList>, TermList>() {
            @Override
            public TermList call(ServiceResponse<TermList> response) {
                return response.body();
            }
        });
    }
133186
public static Map<String,Object> toMetaDatas(String contentType, String fileName){
        Map<String,Object> metadatas = new HashMap<String, Object>();
        putMetaDatas(metadatas, contentType, fileName);
        return metadatas;
    }
718403
function ContentListBaseViewModel(api, apiResourceName, settings) {
    var self = this;

    if (!api) {
      throw new Error('ContentListBaseViewModel - missing api');
    }

    if (!apiResourceName) {
      throw new Error('ContentListBaseViewModel - missing api resource name');
    }

    var defaultSettings = {
      defaultSearchArguments: {},
      pageable: true
    };

    self.disposer = new _kocoDisposer2.default();
    self.apiResourceName = apiResourceName;
    self.api = api;

    self.settings = _jquery2.default.extend({}, defaultSettings, settings);

    var pagingAttr = {
      pageNumber: 'pageNumber',
      pageSize: 'pageSize',
      orderBy: 'orderBy',
      orderByDirection: 'orderByDirection'
    };

    self.settings.defaultPagingAttr = _jquery2.default.extend({}, pagingAttr, self.settings.defaultPagingAttr);

    var defaultPagingArguments = {};
    _lodash2.default.each(self.settings.defaultPagingAttr, function (attr /*, key*/) {
      defaultPagingArguments[attr] = null;
    });

    self.apiSearchArguments = Object.keys(self.settings.defaultSearchArguments).concat(Object.keys(defaultPagingArguments));
    self.searchArguments = null;
    self.isSearchInProgress = _knockout2.default.observable(false);
    self.searchArguments = self.settings.defaultSearchArguments;
    self.totalNumberOfItems = _knockout2.default.observable();
    self.items = _knockout2.default.observableArray([]);

    self.hasItems = _knockout2.default.pureComputed(function () {
      return self.items().length > 0;
    });
    self.disposer.add(self.hasItems);

    self.pagingArguments = _knockout2.default.observable(defaultPagingArguments);

    self.remainingItemsToLoad = _knockout2.default.observable(false);

    self.isPaging = _knockout2.default.observable(false);
  }
1166023
private Entity<String> serialize(Object obj, String contentType) throws ClientErrorException {
        if (contentType.startsWith("application/json")) {
            try {
                return Entity.json(jsonMarshaller.serialize(obj));
            } catch (JsonMarshallingException e) {
                String msg = "Failed marshalling object to JSON data for sending to server: "+e.getMessage();
//                throw new ClientErrorException(Response.Status.BAD_REQUEST, e);
                throw new BadRequestServiceException(
                        new RestFaultInfo("BadRequest", Blame.CLIENT,
                                msg, ""+ ErrorCodes.Client.MARSHALLING_FAILED.getCode(),
                                null,
                                Retry.no(), Retry.no(),
                                Response.Status.BAD_REQUEST.getStatusCode(),
                                Response.Status.BAD_REQUEST.getReasonPhrase()
                        ), e
                );
            }
        } else {
            String msg = "Content type \"" + contentType + "\" is not supported.";
//            throw new NotSupportedException(msg);
            throw new BadRequestServiceException(
                    new RestFaultInfo("BadRequest", Blame.CLIENT,
                            msg, ""+ ErrorCodes.Client.UNSUPPORTED_TECHNOLOGY.getCode(),
                            null,
                            Retry.no(), Retry.no(),
                            Response.Status.BAD_REQUEST.getStatusCode(),
                            Response.Status.BAD_REQUEST.getReasonPhrase()
                    )
            );
        }
    }
1276385
public static Action contentType(final String contentType) {
        return new Action(r -> {
            r.setContentType(contentType);
            return r;
        });
    }
1043859
public Observable<ServiceResponse<ListLabsResponseInner>> listLabsWithServiceResponseAsync(String userName) {
        if (userName == null) {
            throw new IllegalArgumentException("Parameter userName is required and cannot be null.");
        }
        if (this.client.apiVersion() == null) {
            throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
        }
        return service.listLabs(userName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ListLabsResponseInner>>>() {
                @Override
                public Observable<ServiceResponse<ListLabsResponseInner>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<ListLabsResponseInner> clientResponse = listLabsDelegate(response);
                        return Observable.just(clientResponse);
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }
1273664
public function parse($rawBody, $contentType)
    {
        try {
            return Json::decode($rawBody, $this->asArray);
        } catch (\Exception $e) {
            if ($this->throwException) {
                throw new RequestException('Invalid JSON data in request body: ' . $e->getMessage(), [], $e);
            }

            return null;
        }
    }
740921
public Observable<ServiceResponse<Page<ApplicationGatewayInner>>> listAllSinglePageAsync() {
        if (this.client.subscriptionId() == null) {
            throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
        }
        final String apiVersion = "2017-10-01";
        return service.listAll(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
            .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<ApplicationGatewayInner>>>>() {
                @Override
                public Observable<ServiceResponse<Page<ApplicationGatewayInner>>> call(Response<ResponseBody> response) {
                    try {
                        ServiceResponse<PageImpl<ApplicationGatewayInner>> result = listAllDelegate(response);
                        return Observable.just(new ServiceResponse<Page<ApplicationGatewayInner>>(result.body(), result.response()));
                    } catch (Throwable t) {
                        return Observable.error(t);
                    }
                }
            });
    }
349118
public static function create($contentType, $content = '', $bodyStream = null)
    {
        /* @var ResponseInterface|MockInterface $response */
        $response = Mockery::mock(ResponseInterface::class);

        $response
            ->shouldReceive('getHeader')
            ->with('content-type')
            ->andReturn([
                $contentType,
            ]);

        $response
            ->shouldReceive('getHeaderLine')
            ->with('content-type')
            ->andReturn($contentType);

        if (empty($bodyStream)) {
            /* @var StreamInterface|Mock $bodyStream */
            $bodyStream = Mockery::mock(StreamInterface::class);
            $bodyStream
                ->shouldReceive('__toString')
                ->andReturn($content);
        }

        $response
            ->shouldReceive('getBody')
            ->andReturn($bodyStream);

        return $response;
    }
281090
public static ContentData create(byte[] data, String type, @Nullable String name) {
        return new ContentData(RequestBody.create(MediaType.parse(type), data), name);
    }
103321
public void setContent(final byte[] content,
                         final String contentType) throws HttpException {
    if (!(method instanceof HttpEntityEnclosingRequestBase)) {
      throw new HttpException("Invalid operation for method " +
                               method.getMethod());
    }

    final HttpEntityEnclosingRequestBase eem = (HttpEntityEnclosingRequestBase)method;

    ByteArrayEntity entity = new ByteArrayEntity(content);
    entity.setContentType(contentType);
    eem.setEntity(entity);
  }
910127
public MultipartBuilder type(MediaType type) {
        if (type == null) {
            throw new NullPointerException("type == null");
        }
        if (!type.type().equals("multipart")) {
            throw new IllegalArgumentException("multipart != " + type);
        }
        this.type = type;
        return this;
    }
1019241
public static Response put(URI uri, String body, ContentType contentType, String username, String password) throws URISyntaxException, HttpException {
        return putBody(new HttpPut(uri), body, contentType, new UsernamePasswordCredentials(username, password), null);
    }