/// <inheritdoc /> public override BigQueryModel GetModel(ModelReference modelReference, GetModelOptions options = null) { var request = CreateGetModelRequest(modelReference, options); var resource = request.Execute(); return(new BigQueryModel(this, resource)); }
private GetRequest CreateGetModelRequest(ModelReference modelReference, GetModelOptions options) { GaxPreconditions.CheckNotNull(modelReference, nameof(modelReference)); var request = Service.Models.Get(modelReference.ProjectId, modelReference.DatasetId, modelReference.ModelId); options?.ModifyRequest(request); RetryHandler.MarkAsRetriable(request); return(request); }
/// <summary> /// Asynchronously retrieves the specified model. /// </summary> /// <param name="modelReference">A fully-qualified identifier for the model. Must not be null.</param> /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param> /// <param name="cancellationToken">The token to monitor for cancellation requests.</param> /// <returns>A task representing the asynchronous operation. When complete, the result is /// the requested model.</returns> public virtual Task <BigQueryModel> GetModelAsync(ModelReference modelReference, GetModelOptions options = null, CancellationToken cancellationToken = default) => throw new NotImplementedException();
/// <summary> /// Asynchronously retrieves the specified model. /// This method just creates a <see cref="ModelReference"/> and delegates to <see cref="GetModelAsync(ModelReference, GetModelOptions, CancellationToken)"/>. /// </summary> /// <param name="projectId">The project ID. Must not be null.</param> /// <param name="datasetId">The dataset ID. Must not be null.</param> /// <param name="modelId">The model ID. Must not be null.</param> /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param> /// <param name="cancellationToken">The token to monitor for cancellation requests.</param> /// <returns>A task representing the asynchronous operation. When complete, the result is /// the requested model.</returns> public virtual Task <BigQueryModel> GetModelAsync(string projectId, string datasetId, string modelId, GetModelOptions options = null, CancellationToken cancellationToken = default) => GetModelAsync(GetModelReference(projectId, datasetId, modelId), options, cancellationToken);
/// <summary> /// Retrieves the specified model. /// </summary> /// <param name="modelReference">A fully-qualified identifier for the model. Must not be null.</param> /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param> /// <returns>The requested model.</returns> public virtual BigQueryModel GetModel(ModelReference modelReference, GetModelOptions options = null) => throw new NotImplementedException();
/// <summary> /// Retrieves the specified model. /// This method just creates a <see cref="ModelReference"/> and delegates to <see cref="GetModel(ModelReference, GetModelOptions)"/>. /// </summary> /// <param name="projectId">The project ID. Must not be null.</param> /// <param name="datasetId">The dataset ID. Must not be null.</param> /// <param name="modelId">The model ID. Must not be null.</param> /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param> /// <returns>The requested model.</returns> public virtual BigQueryModel GetModel(string projectId, string datasetId, string modelId, GetModelOptions options = null) => GetModel(GetModelReference(projectId, datasetId, modelId), options);
/// <summary> /// Asynchronously retrieves a model within this dataset. /// This method just creates a <see cref="ModelReference"/> and delegates to <see cref="BigQueryClient.GetModel(ModelReference, GetModelOptions)"/>. /// </summary> /// <param name="modelId">The model ID. Must not be null.</param> /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param> /// <returns>A task representing the asynchronous operation. When complete, the result is /// the requested table.</returns> public Task <BigQueryModel> GetModelAsync(string modelId, GetModelOptions options = null) => _client.GetModelAsync(GetModelReference(modelId), options);
/// <summary> /// Retrieves a model within this dataset. /// This method just creates a <see cref="ModelReference"/> and delegates to <see cref="BigQueryClient.GetModel(ModelReference, GetModelOptions)"/>. /// </summary> /// <param name="modelId">The model ID. Must not be null.</param> /// <param name="options">The options for the operation. May be null, in which case defaults will be supplied.</param> /// <returns>The requested model.</returns> public BigQueryModel GetModel(string modelId, GetModelOptions options = null) => _client.GetModel(GetModelReference(modelId), options);
/// <inheritdoc /> public override async Task <BigQueryModel> GetModelAsync(ModelReference modelReference, GetModelOptions options = null, CancellationToken cancellationToken = default) { var request = CreateGetModelRequest(modelReference, options); var resource = await request.ExecuteAsync().ConfigureAwait(false); return(new BigQueryModel(this, resource)); }