/** # Ids * * Several places in the elasticsearch API expect an Id object to be passed. This is a special box type that you can implicitly convert to and from many value types. */ /** Methods that take an Id can be passed longs, ints, strings & Guids and they will implicitly converted to Ids */ [U] public void CanImplicitlyConvertToId() { Nest.Id idFromInt = 1; Nest.Id idFromLong = 2L; Nest.Id idFromString = "hello-world"; Nest.Id idFromGuid = new Guid("D70BD3CF-4E38-46F3-91CA-FCBEF29B148E"); Expect(1).WhenSerializing(idFromInt); Expect(2).WhenSerializing(idFromLong); Expect("hello-world").WhenSerializing(idFromString); Expect("d70bd3cf-4e38-46f3-91ca-fcbef29b148e").WhenSerializing(idFromGuid); }
/// <inheritdoc/> public IDeletePipelineResponse DeletePipeline(Id id, Func <DeletePipelineDescriptor, IDeletePipelineRequest> selector = null) => this.DeletePipeline(selector.InvokeOrDefault(new DeletePipelineDescriptor(id)));
/// <inheritdoc /> public Task <IForecastJobResponse> ForecastJobAsync(Id jobId, Func <ForecastJobDescriptor, IForecastJobRequest> selector = null, CancellationToken cancellationToken = default(CancellationToken) ) => ForecastJobAsync(selector.InvokeOrDefault(new ForecastJobDescriptor(jobId)), cancellationToken);
///<summary>/_slm/policy/{policy_id}/_execute</summary> ///<param name = "policyId">this parameter is required</param> public ExecuteSnapshotLifecycleDescriptor(Id policyId) : base(r => r.Required("policy_id", policyId)) { }
/// <inheritdoc /> public Task <DeactivateWatchResponse> DeactivateWatchAsync( Id id, Func <DeactivateWatchDescriptor, IDeactivateWatchRequest> selector = null, CancellationToken ct = default ) => DeactivateWatchAsync(selector.InvokeOrDefault(new DeactivateWatchDescriptor(id)), ct);
/// <summary> /// Manually set the id for the newly created object /// </summary> public TDescriptor Id(Id id) => Assign(id, (a, v) => a.Id = v);
///<summary>Comma separated list of pipeline ids. Wildcards supported</summary> public GetPipelineDescriptor Id(Id id) => Assign(id, (a, v) => a.RouteValues.Optional("id", v));
///<summary>/_ingest/pipeline/{id}/_simulate</summary> ///<param name = "id">Optional, accepts null</param> public SimulatePipelineDescriptor(Id id) : base(r => r.Optional("id", id)) { }
private string ResolveId(Id id, IConnectionSettingsValues nestSettings) => id.Document != null?nestSettings.Inferrer.Id(id.Document) : id.StringOrLongValue;
/// <inheritdoc /> public Task <IGetScriptResponse> GetScriptAsync(Id id, Func <GetScriptDescriptor, IGetScriptRequest> selector = null, CancellationToken cancellationToken = default(CancellationToken) ) => GetScriptAsync(selector.InvokeOrDefault(new GetScriptDescriptor(id)), cancellationToken);
/// <inheritdoc /> public IGetScriptResponse GetScript(Id id, Func <GetScriptDescriptor, IGetScriptRequest> selector = null) => GetScript(selector.InvokeOrDefault(new GetScriptDescriptor(id)));
///<summary>/_rollup/job/{id}</summary> ///<param name = "id">Optional, accepts null</param> public GetRollupJobRequest(Id id) : base(r => r.Optional("id", id)) { }
///<summary>/_rollup/job/{id}</summary> ///<param name = "id">this parameter is required</param> public DeleteRollupJobRequest(Id id) : base(r => r.Required("id", id)) { }
///<summary>/_rollup/data/{id}</summary> ///<param name = "id">Optional, accepts null</param> public GetRollupCapabilitiesRequest(Id id) : base(r => r.Optional("id", id)) { }
/// <inheritdoc /> public CreateRollupJobResponse CreateRollupJob <T>(Id id, Func <CreateRollupJobDescriptor <T>, ICreateRollupJobRequest> selector) where T : class => CreateRollupJob(selector.InvokeOrDefault(new CreateRollupJobDescriptor <T>(id)));
public MultiTermVectorOperationDescriptor <T> Id(Id id) => Assign(a => a.Id = id);
public MultiTermVectorOperation(Id id) { this.Id = id; this.Index = typeof(T); this.Type = typeof(T); }
public IDeleteSearchTemplateResponse DeleteSearchTemplate(Id id, Func <DeleteSearchTemplateDescriptor, IDeleteSearchTemplateRequest> selector = null) => this.DeleteSearchTemplate(selector.InvokeOrDefault(new DeleteSearchTemplateDescriptor(id)));
///<summary>/_ingest/pipeline/{id}</summary> ///<param name = "id">Optional, accepts null</param> public GetPipelineDescriptor(Id id) : base(r => r.Optional("id", id)) { }
public Task <IDeleteSearchTemplateResponse> DeleteSearchTemplateAsync(Id id, Func <DeleteSearchTemplateDescriptor, IDeleteSearchTemplateRequest> selector = null, CancellationToken cancellationToken = default(CancellationToken)) => this.DeleteSearchTemplateAsync(selector.InvokeOrDefault(new DeleteSearchTemplateDescriptor(id)), cancellationToken);
///<summary>/_ingest/pipeline/{id}</summary> ///<param name = "id">this parameter is required</param> public PutPipelineDescriptor(Id id) : base(r => r.Required("id", id)) { }
/// <inheritdoc cref="IPhraseSuggestCollateQuery.Id" /> public PhraseSuggestCollateQueryDescriptor Id(Id id) => Assign(id, (a, v) => a.Id = v);
/// <inheritdoc /> public DeactivateWatchResponse DeactivateWatch(Id id, Func <DeactivateWatchDescriptor, IDeactivateWatchRequest> selector = null) => DeactivateWatch(selector.InvokeOrDefault(new DeactivateWatchDescriptor(id)));
public static JoinField Link(RelationName child, Id parentId) => new Child(child, parentId);
public ParentIdQueryDescriptor <T> Id(Id id) => Assign(id, (a, v) => a.Id = v);
public static JoinField Link <TChild, TParentDocument>(TParentDocument parent) where TParentDocument : class => new Child(typeof(TChild), Id.From <TParentDocument>(parent));
/// <inheritdoc /> public IForecastJobResponse ForecastJob(Id jobId, Func <ForecastJobDescriptor, IForecastJobRequest> selector = null) => ForecastJob(selector.InvokeOrDefault(new ForecastJobDescriptor(jobId)));
public static JoinField Link <TChild>(Id parentId) => new Child(typeof(TChild), parentId);
public Child(RelationName name, Id parent) { Name = name; Parent = parent; }
/// <inheritdoc /> public ActivateWatchResponse ActivateWatch(Id id, Func <ActivateWatchDescriptor, IActivateWatchRequest> selector = null) => ActivateWatch(selector.InvokeOrDefault(new ActivateWatchDescriptor(id)));