diff --git a/BigQueryMigration/metadata/V2/MigrationEntities.php b/BigQueryMigration/metadata/V2/MigrationEntities.php index 94a42b94cfce..e65e9b3cb751 100644 --- a/BigQueryMigration/metadata/V2/MigrationEntities.php +++ b/BigQueryMigration/metadata/V2/MigrationEntities.php @@ -25,7 +25,7 @@ public static function initOnce() { \GPBMetadata\Google\Protobuf\Timestamp::initOnce(); \GPBMetadata\Google\Rpc\ErrorDetails::initOnce(); $pool->internalAddGeneratedFile( - "\x0A\x9D\x1C\x0A;google/cloud/bigquery/migration/v2/migration_entities.proto\x12\"google.cloud.bigquery.migration.v2\x1A\x19google/api/resource.proto\x1A8google/cloud/bigquery/migration/v2/assessment_task.proto\x1A@google/cloud/bigquery/migration/v2/migration_error_details.proto\x1A:google/cloud/bigquery/migration/v2/migration_metrics.proto\x1A;google/cloud/bigquery/migration/v2/translation_config.proto\x1Agoogle/cloud/bigquery/migration/v2/translation_usability.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\x1A\x1Egoogle/rpc/error_details.proto\"\x80\x05\x0A\x11MigrationWorkflow\x12\x17\x0A\x04name\x18\x01 \x01(\x09B\x09\xE0A\x03\xE0A\x05\xE0A\x08\x12\x14\x0A\x0Cdisplay_name\x18\x06 \x01(\x09\x12O\x0A\x05tasks\x18\x02 \x03(\x0B2@.google.cloud.bigquery.migration.v2.MigrationWorkflow.TasksEntry\x12O\x0A\x05state\x18\x03 \x01(\x0E2;.google.cloud.bigquery.migration.v2.MigrationWorkflow.StateB\x03\xE0A\x03\x124\x0A\x0Bcreate_time\x18\x04 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x129\x0A\x10last_update_time\x18\x05 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x1A_\x0A\x0ATasksEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12@\x0A\x05value\x18\x02 \x01(\x0B21.google.cloud.bigquery.migration.v2.MigrationTask:\x028\x01\"Q\x0A\x05State\x12\x15\x0A\x11STATE_UNSPECIFIED\x10\x00\x12\x09\x0A\x05DRAFT\x10\x01\x12\x0B\x0A\x07RUNNING\x10\x02\x12\x0A\x0A\x06PAUSED\x10\x03\x12\x0D\x0A\x09COMPLETED\x10\x04:u\xEAAr\x0A2bigquerymigration.googleapis.com/MigrationWorkflow\x12google/cloud/bigquery/migration/v2/translation_usability.proto\x1A\x1Fgoogle/protobuf/timestamp.proto\x1A\x1Egoogle/rpc/error_details.proto\"\x80\x05\x0A\x11MigrationWorkflow\x12\x17\x0A\x04name\x18\x01 \x01(\x09B\x09\xE0A\x03\xE0A\x05\xE0A\x08\x12\x14\x0A\x0Cdisplay_name\x18\x06 \x01(\x09\x12O\x0A\x05tasks\x18\x02 \x03(\x0B2@.google.cloud.bigquery.migration.v2.MigrationWorkflow.TasksEntry\x12O\x0A\x05state\x18\x03 \x01(\x0E2;.google.cloud.bigquery.migration.v2.MigrationWorkflow.StateB\x03\xE0A\x03\x124\x0A\x0Bcreate_time\x18\x04 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x129\x0A\x10last_update_time\x18\x05 \x01(\x0B2\x1A.google.protobuf.TimestampB\x03\xE0A\x03\x1A_\x0A\x0ATasksEntry\x12\x0B\x0A\x03key\x18\x01 \x01(\x09\x12@\x0A\x05value\x18\x02 \x01(\x0B21.google.cloud.bigquery.migration.v2.MigrationTask:\x028\x01\"Q\x0A\x05State\x12\x15\x0A\x11STATE_UNSPECIFIED\x10\x00\x12\x09\x0A\x05DRAFT\x10\x01\x12\x0B\x0A\x07RUNNING\x10\x02\x12\x0A\x0A\x06PAUSED\x10\x03\x12\x0D\x0A\x09COMPLETED\x10\x04:u\xEAAr\x0A2bigquerymigration.googleapis.com/MigrationWorkflow\x12google.cloud.bigquery.migration.v2.LineageOutput + */ +class LineageOutput extends \Google\Protobuf\Internal\Message +{ + /** + * The URI of the webapp that visualizes the lineage. + * The user needs the `bigquerymigration.googleapis.com/lineageDbs.query` IAM + * permission to use the webapp. + * + * Generated from protobuf field string webapp_uri = 1; + */ + protected $webapp_uri = ''; + /** + * Output only. Recognized lineage inputs. + * All inputs are processed only if the task succeeds and all work is in state + * [SUCCEEDED](ProgressReport.WorkSummary.State.SUCCEEDED) (in particular, + * nothing is [SKIPPED](ProgressReport.WorkSummary.State.SKIPPED)). + * Even with all inputs processed successfully, there may be transpiler errors + * present leading to inaccurate lineage. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.LineageOutput.RecognizedInput recognized_inputs = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $recognized_inputs; + /** + * Output only. Work processing progress reports broken up by processing + * stage. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.LineageOutput.ProgressReport processing_progress_reports = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $processing_progress_reports; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type string $webapp_uri + * The URI of the webapp that visualizes the lineage. + * The user needs the `bigquerymigration.googleapis.com/lineageDbs.query` IAM + * permission to use the webapp. + * @type \Google\Cloud\BigQuery\Migration\V2\LineageOutput\RecognizedInput[] $recognized_inputs + * Output only. Recognized lineage inputs. + * All inputs are processed only if the task succeeds and all work is in state + * [SUCCEEDED](ProgressReport.WorkSummary.State.SUCCEEDED) (in particular, + * nothing is [SKIPPED](ProgressReport.WorkSummary.State.SKIPPED)). + * Even with all inputs processed successfully, there may be transpiler errors + * present leading to inaccurate lineage. + * @type \Google\Cloud\BigQuery\Migration\V2\LineageOutput\ProgressReport[] $processing_progress_reports + * Output only. Work processing progress reports broken up by processing + * stage. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\MigrationEntities::initOnce(); + parent::__construct($data); + } + + /** + * The URI of the webapp that visualizes the lineage. + * The user needs the `bigquerymigration.googleapis.com/lineageDbs.query` IAM + * permission to use the webapp. + * + * Generated from protobuf field string webapp_uri = 1; + * @return string + */ + public function getWebappUri() + { + return $this->webapp_uri; + } + + /** + * The URI of the webapp that visualizes the lineage. + * The user needs the `bigquerymigration.googleapis.com/lineageDbs.query` IAM + * permission to use the webapp. + * + * Generated from protobuf field string webapp_uri = 1; + * @param string $var + * @return $this + */ + public function setWebappUri($var) + { + GPBUtil::checkString($var, True); + $this->webapp_uri = $var; + + return $this; + } + + /** + * Output only. Recognized lineage inputs. + * All inputs are processed only if the task succeeds and all work is in state + * [SUCCEEDED](ProgressReport.WorkSummary.State.SUCCEEDED) (in particular, + * nothing is [SKIPPED](ProgressReport.WorkSummary.State.SKIPPED)). + * Even with all inputs processed successfully, there may be transpiler errors + * present leading to inaccurate lineage. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.LineageOutput.RecognizedInput recognized_inputs = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField<\Google\Cloud\BigQuery\Migration\V2\LineageOutput\RecognizedInput> + */ + public function getRecognizedInputs() + { + return $this->recognized_inputs; + } + + /** + * Output only. Recognized lineage inputs. + * All inputs are processed only if the task succeeds and all work is in state + * [SUCCEEDED](ProgressReport.WorkSummary.State.SUCCEEDED) (in particular, + * nothing is [SKIPPED](ProgressReport.WorkSummary.State.SKIPPED)). + * Even with all inputs processed successfully, there may be transpiler errors + * present leading to inaccurate lineage. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.LineageOutput.RecognizedInput recognized_inputs = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\BigQuery\Migration\V2\LineageOutput\RecognizedInput[] $var + * @return $this + */ + public function setRecognizedInputs($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Migration\V2\LineageOutput\RecognizedInput::class); + $this->recognized_inputs = $arr; + + return $this; + } + + /** + * Output only. Work processing progress reports broken up by processing + * stage. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.LineageOutput.ProgressReport processing_progress_reports = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField<\Google\Cloud\BigQuery\Migration\V2\LineageOutput\ProgressReport> + */ + public function getProcessingProgressReports() + { + return $this->processing_progress_reports; + } + + /** + * Output only. Work processing progress reports broken up by processing + * stage. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.LineageOutput.ProgressReport processing_progress_reports = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\BigQuery\Migration\V2\LineageOutput\ProgressReport[] $var + * @return $this + */ + public function setProcessingProgressReports($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Migration\V2\LineageOutput\ProgressReport::class); + $this->processing_progress_reports = $arr; + + return $this; + } + +} + diff --git a/BigQueryMigration/src/V2/LineageOutput/ProgressReport.php b/BigQueryMigration/src/V2/LineageOutput/ProgressReport.php new file mode 100644 index 000000000000..fc7c4015f90d --- /dev/null +++ b/BigQueryMigration/src/V2/LineageOutput/ProgressReport.php @@ -0,0 +1,113 @@ +google.cloud.bigquery.migration.v2.LineageOutput.ProgressReport + */ +class ProgressReport extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The processing stage this progress report describes. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.LineageOutput.ProgressReport.ProcessingStage processing_stage = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $processing_stage = 0; + /** + * Output only. Summaries of work broken up by the state of the work. Each + * work summary describes how much work is in the given state. + * To get numbers for the total work covered, aggregate the numbers from all + * summaries. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.LineageOutput.ProgressReport.WorkSummary work_summaries = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + private $work_summaries; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $processing_stage + * Output only. The processing stage this progress report describes. + * @type \Google\Cloud\BigQuery\Migration\V2\LineageOutput\ProgressReport\WorkSummary[] $work_summaries + * Output only. Summaries of work broken up by the state of the work. Each + * work summary describes how much work is in the given state. + * To get numbers for the total work covered, aggregate the numbers from all + * summaries. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\MigrationEntities::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The processing stage this progress report describes. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.LineageOutput.ProgressReport.ProcessingStage processing_stage = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getProcessingStage() + { + return $this->processing_stage; + } + + /** + * Output only. The processing stage this progress report describes. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.LineageOutput.ProgressReport.ProcessingStage processing_stage = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setProcessingStage($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Migration\V2\LineageOutput\ProgressReport\ProcessingStage::class); + $this->processing_stage = $var; + + return $this; + } + + /** + * Output only. Summaries of work broken up by the state of the work. Each + * work summary describes how much work is in the given state. + * To get numbers for the total work covered, aggregate the numbers from all + * summaries. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.LineageOutput.ProgressReport.WorkSummary work_summaries = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return RepeatedField<\Google\Cloud\BigQuery\Migration\V2\LineageOutput\ProgressReport\WorkSummary> + */ + public function getWorkSummaries() + { + return $this->work_summaries; + } + + /** + * Output only. Summaries of work broken up by the state of the work. Each + * work summary describes how much work is in the given state. + * To get numbers for the total work covered, aggregate the numbers from all + * summaries. + * + * Generated from protobuf field repeated .google.cloud.bigquery.migration.v2.LineageOutput.ProgressReport.WorkSummary work_summaries = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param \Google\Cloud\BigQuery\Migration\V2\LineageOutput\ProgressReport\WorkSummary[] $var + * @return $this + */ + public function setWorkSummaries($var) + { + $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Migration\V2\LineageOutput\ProgressReport\WorkSummary::class); + $this->work_summaries = $arr; + + return $this; + } + +} + diff --git a/BigQueryMigration/src/V2/LineageOutput/ProgressReport/ProcessingStage.php b/BigQueryMigration/src/V2/LineageOutput/ProgressReport/ProcessingStage.php new file mode 100644 index 000000000000..dad32276224b --- /dev/null +++ b/BigQueryMigration/src/V2/LineageOutput/ProgressReport/ProcessingStage.php @@ -0,0 +1,61 @@ +google.cloud.bigquery.migration.v2.LineageOutput.ProgressReport.ProcessingStage + */ +class ProcessingStage +{ + /** + * The stage is not specified. + * + * Generated from protobuf enum PROCESSING_STAGE_UNSPECIFIED = 0; + */ + const PROCESSING_STAGE_UNSPECIFIED = 0; + /** + * The input ingestion stage. + * + * Generated from protobuf enum INPUT_INGESTION = 1000; + */ + const INPUT_INGESTION = 1000; + /** + * The lineage DB postprocessing stage. + * + * Generated from protobuf enum POSTPROCESSING = 2000; + */ + const POSTPROCESSING = 2000; + + private static $valueToName = [ + self::PROCESSING_STAGE_UNSPECIFIED => 'PROCESSING_STAGE_UNSPECIFIED', + self::INPUT_INGESTION => 'INPUT_INGESTION', + self::POSTPROCESSING => 'POSTPROCESSING', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/BigQueryMigration/src/V2/LineageOutput/ProgressReport/WorkSummary.php b/BigQueryMigration/src/V2/LineageOutput/ProgressReport/WorkSummary.php new file mode 100644 index 000000000000..ab197ba24b63 --- /dev/null +++ b/BigQueryMigration/src/V2/LineageOutput/ProgressReport/WorkSummary.php @@ -0,0 +1,143 @@ +google.cloud.bigquery.migration.v2.LineageOutput.ProgressReport.WorkSummary + */ +class WorkSummary extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The state of the work this summary describes. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.LineageOutput.ProgressReport.WorkSummary.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * Output only. Size of the work in the given State. + * Size counts "units of work". Units represent arbitrary division of + * work; there's no expectation each unit takes similar time to process. + * + * Generated from protobuf field int64 size = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $size = 0; + /** + * Output only. Human-readable comment. + * + * Generated from protobuf field string comment = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $comment = ''; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $state + * Output only. The state of the work this summary describes. + * @type int|string $size + * Output only. Size of the work in the given State. + * Size counts "units of work". Units represent arbitrary division of + * work; there's no expectation each unit takes similar time to process. + * @type string $comment + * Output only. Human-readable comment. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\MigrationEntities::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The state of the work this summary describes. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.LineageOutput.ProgressReport.WorkSummary.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The state of the work this summary describes. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.LineageOutput.ProgressReport.WorkSummary.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Migration\V2\LineageOutput\ProgressReport\WorkSummary\State::class); + $this->state = $var; + + return $this; + } + + /** + * Output only. Size of the work in the given State. + * Size counts "units of work". Units represent arbitrary division of + * work; there's no expectation each unit takes similar time to process. + * + * Generated from protobuf field int64 size = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getSize() + { + return $this->size; + } + + /** + * Output only. Size of the work in the given State. + * Size counts "units of work". Units represent arbitrary division of + * work; there's no expectation each unit takes similar time to process. + * + * Generated from protobuf field int64 size = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setSize($var) + { + GPBUtil::checkInt64($var); + $this->size = $var; + + return $this; + } + + /** + * Output only. Human-readable comment. + * + * Generated from protobuf field string comment = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return string + */ + public function getComment() + { + return $this->comment; + } + + /** + * Output only. Human-readable comment. + * + * Generated from protobuf field string comment = 3 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param string $var + * @return $this + */ + public function setComment($var) + { + GPBUtil::checkString($var, True); + $this->comment = $var; + + return $this; + } + +} + diff --git a/BigQueryMigration/src/V2/LineageOutput/ProgressReport/WorkSummary/State.php b/BigQueryMigration/src/V2/LineageOutput/ProgressReport/WorkSummary/State.php new file mode 100644 index 000000000000..6a1a354a2bcf --- /dev/null +++ b/BigQueryMigration/src/V2/LineageOutput/ProgressReport/WorkSummary/State.php @@ -0,0 +1,78 @@ +google.cloud.bigquery.migration.v2.LineageOutput.ProgressReport.WorkSummary.State + */ +class State +{ + /** + * The state is not specified. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Work that was processed successfully. + * + * Generated from protobuf enum SUCCEEDED = 1; + */ + const SUCCEEDED = 1; + /** + * Work that failed processing. + * + * Generated from protobuf enum FAILED = 2; + */ + const FAILED = 2; + /** + * Work that is currently being processed or queued for processing. + * + * Generated from protobuf enum IN_PROGRESS = 3; + */ + const IN_PROGRESS = 3; + /** + * Work that was recognised as necessary to fully process inputs but was + * skipped due to system limitations. + * + * Generated from protobuf enum SKIPPED = 4; + */ + const SKIPPED = 4; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::SUCCEEDED => 'SUCCEEDED', + self::FAILED => 'FAILED', + self::IN_PROGRESS => 'IN_PROGRESS', + self::SKIPPED => 'SKIPPED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/BigQueryMigration/src/V2/LineageOutput/RecognizedInput.php b/BigQueryMigration/src/V2/LineageOutput/RecognizedInput.php new file mode 100644 index 000000000000..8ee621bd7309 --- /dev/null +++ b/BigQueryMigration/src/V2/LineageOutput/RecognizedInput.php @@ -0,0 +1,109 @@ +google.cloud.bigquery.migration.v2.LineageOutput.RecognizedInput + */ +class RecognizedInput extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The type of the input. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.LineageOutput.RecognizedInput.Type type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $type = 0; + /** + * Output only. The uncompressed size of the recognized input of the given + * type. + * + * Generated from protobuf field int64 uncompressed_size_bytes = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $uncompressed_size_bytes = 0; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type int $type + * Output only. The type of the input. + * @type int|string $uncompressed_size_bytes + * Output only. The uncompressed size of the recognized input of the given + * type. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\MigrationEntities::initOnce(); + parent::__construct($data); + } + + /** + * Output only. The type of the input. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.LineageOutput.RecognizedInput.Type type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * Output only. The type of the input. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.LineageOutput.RecognizedInput.Type type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setType($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Migration\V2\LineageOutput\RecognizedInput\Type::class); + $this->type = $var; + + return $this; + } + + /** + * Output only. The uncompressed size of the recognized input of the given + * type. + * + * Generated from protobuf field int64 uncompressed_size_bytes = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int|string + */ + public function getUncompressedSizeBytes() + { + return $this->uncompressed_size_bytes; + } + + /** + * Output only. The uncompressed size of the recognized input of the given + * type. + * + * Generated from protobuf field int64 uncompressed_size_bytes = 2 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int|string $var + * @return $this + */ + public function setUncompressedSizeBytes($var) + { + GPBUtil::checkInt64($var); + $this->uncompressed_size_bytes = $var; + + return $this; + } + +} + diff --git a/BigQueryMigration/src/V2/LineageOutput/RecognizedInput/Type.php b/BigQueryMigration/src/V2/LineageOutput/RecognizedInput/Type.php new file mode 100644 index 000000000000..98588c6e4155 --- /dev/null +++ b/BigQueryMigration/src/V2/LineageOutput/RecognizedInput/Type.php @@ -0,0 +1,68 @@ +google.cloud.bigquery.migration.v2.LineageOutput.RecognizedInput.Type + */ +class Type +{ + /** + * The type is not specified. + * + * Generated from protobuf enum TYPE_UNSPECIFIED = 0; + */ + const TYPE_UNSPECIFIED = 0; + /** + * The input is metadata. + * + * Generated from protobuf enum METADATA = 1; + */ + const METADATA = 1; + /** + * The input is a query log. + * + * Generated from protobuf enum QUERY_LOG = 2; + */ + const QUERY_LOG = 2; + /** + * The input is a SQL script. + * + * Generated from protobuf enum SCRIPT = 3; + */ + const SCRIPT = 3; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::METADATA => 'METADATA', + self::QUERY_LOG => 'QUERY_LOG', + self::SCRIPT => 'SCRIPT', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} + diff --git a/BigQueryMigration/src/V2/MigrationTaskResult.php b/BigQueryMigration/src/V2/MigrationTaskResult.php index 66992b7c01fb..346b0e56d987 100644 --- a/BigQueryMigration/src/V2/MigrationTaskResult.php +++ b/BigQueryMigration/src/V2/MigrationTaskResult.php @@ -15,6 +15,12 @@ */ class MigrationTaskResult extends \Google\Protobuf\Internal\Message { + /** + * The map of task output types to the task outputs, e.g. "LINEAGE". + * + * Generated from protobuf field map task_outputs = 3; + */ + private $task_outputs; protected $details; /** @@ -25,6 +31,8 @@ class MigrationTaskResult extends \Google\Protobuf\Internal\Message * * @type \Google\Cloud\BigQuery\Migration\V2\TranslationTaskResult $translation_task_result * Details specific to translation task types. + * @type array|\Google\Protobuf\Internal\MapField $task_outputs + * The map of task output types to the task outputs, e.g. "LINEAGE". * } */ public function __construct($data = NULL) { @@ -63,6 +71,32 @@ public function setTranslationTaskResult($var) return $this; } + /** + * The map of task output types to the task outputs, e.g. "LINEAGE". + * + * Generated from protobuf field map task_outputs = 3; + * @return \Google\Protobuf\Internal\MapField + */ + public function getTaskOutputs() + { + return $this->task_outputs; + } + + /** + * The map of task output types to the task outputs, e.g. "LINEAGE". + * + * Generated from protobuf field map task_outputs = 3; + * @param array|\Google\Protobuf\Internal\MapField $var + * @return $this + */ + public function setTaskOutputs($var) + { + $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\BigQuery\Migration\V2\TaskOutput::class); + $this->task_outputs = $arr; + + return $this; + } + /** * @return string */ diff --git a/BigQueryMigration/src/V2/TaskOutput.php b/BigQueryMigration/src/V2/TaskOutput.php new file mode 100644 index 000000000000..37ee2212795c --- /dev/null +++ b/BigQueryMigration/src/V2/TaskOutput.php @@ -0,0 +1,157 @@ +google.cloud.bigquery.migration.v2.TaskOutput + */ +class TaskOutput extends \Google\Protobuf\Internal\Message +{ + /** + * Output only. The current state of the task output. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.TaskOutput.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + */ + protected $state = 0; + /** + * An explanation that may be populated when the task output is in FAILED + * state. + * + * Generated from protobuf field .google.rpc.ErrorInfo processing_error = 2; + */ + protected $processing_error = null; + protected $output; + + /** + * Constructor. + * + * @param array $data { + * Optional. Data for populating the Message object. + * + * @type \Google\Cloud\BigQuery\Migration\V2\LineageOutput $lineage_output + * The output of the task with output type "LINEAGE". + * @type int $state + * Output only. The current state of the task output. + * @type \Google\Rpc\ErrorInfo $processing_error + * An explanation that may be populated when the task output is in FAILED + * state. + * } + */ + public function __construct($data = NULL) { + \GPBMetadata\Google\Cloud\Bigquery\Migration\V2\MigrationEntities::initOnce(); + parent::__construct($data); + } + + /** + * The output of the task with output type "LINEAGE". + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.LineageOutput lineage_output = 3; + * @return \Google\Cloud\BigQuery\Migration\V2\LineageOutput|null + */ + public function getLineageOutput() + { + return $this->readOneof(3); + } + + public function hasLineageOutput() + { + return $this->hasOneof(3); + } + + /** + * The output of the task with output type "LINEAGE". + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.LineageOutput lineage_output = 3; + * @param \Google\Cloud\BigQuery\Migration\V2\LineageOutput $var + * @return $this + */ + public function setLineageOutput($var) + { + GPBUtil::checkMessage($var, \Google\Cloud\BigQuery\Migration\V2\LineageOutput::class); + $this->writeOneof(3, $var); + + return $this; + } + + /** + * Output only. The current state of the task output. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.TaskOutput.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @return int + */ + public function getState() + { + return $this->state; + } + + /** + * Output only. The current state of the task output. + * + * Generated from protobuf field .google.cloud.bigquery.migration.v2.TaskOutput.State state = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; + * @param int $var + * @return $this + */ + public function setState($var) + { + GPBUtil::checkEnum($var, \Google\Cloud\BigQuery\Migration\V2\TaskOutput\State::class); + $this->state = $var; + + return $this; + } + + /** + * An explanation that may be populated when the task output is in FAILED + * state. + * + * Generated from protobuf field .google.rpc.ErrorInfo processing_error = 2; + * @return \Google\Rpc\ErrorInfo|null + */ + public function getProcessingError() + { + return $this->processing_error; + } + + public function hasProcessingError() + { + return isset($this->processing_error); + } + + public function clearProcessingError() + { + unset($this->processing_error); + } + + /** + * An explanation that may be populated when the task output is in FAILED + * state. + * + * Generated from protobuf field .google.rpc.ErrorInfo processing_error = 2; + * @param \Google\Rpc\ErrorInfo $var + * @return $this + */ + public function setProcessingError($var) + { + GPBUtil::checkMessage($var, \Google\Rpc\ErrorInfo::class); + $this->processing_error = $var; + + return $this; + } + + /** + * @return string + */ + public function getOutput() + { + return $this->whichOneof("output"); + } + +} + diff --git a/BigQueryMigration/src/V2/TaskOutput/State.php b/BigQueryMigration/src/V2/TaskOutput/State.php new file mode 100644 index 000000000000..1ab17ce4e3ec --- /dev/null +++ b/BigQueryMigration/src/V2/TaskOutput/State.php @@ -0,0 +1,70 @@ +google.cloud.bigquery.migration.v2.TaskOutput.State + */ +class State +{ + /** + * Task output state is unspecified. + * + * Generated from protobuf enum STATE_UNSPECIFIED = 0; + */ + const STATE_UNSPECIFIED = 0; + /** + * Task output is pending. + * + * Generated from protobuf enum PENDING = 1; + */ + const PENDING = 1; + /** + * Task output is succeeded. + * + * Generated from protobuf enum SUCCEEDED = 2; + */ + const SUCCEEDED = 2; + /** + * Task output is failed. This does not mean that there is no useful + * information in the output; partial outputs or failure details may be + * available. + * + * Generated from protobuf enum FAILED = 3; + */ + const FAILED = 3; + + private static $valueToName = [ + self::STATE_UNSPECIFIED => 'STATE_UNSPECIFIED', + self::PENDING => 'PENDING', + self::SUCCEEDED => 'SUCCEEDED', + self::FAILED => 'FAILED', + ]; + + public static function name($value) + { + if (!isset(self::$valueToName[$value])) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no name defined for value %s', __CLASS__, $value)); + } + return self::$valueToName[$value]; + } + + + public static function value($name) + { + $const = __CLASS__ . '::' . strtoupper($name); + if (!defined($const)) { + throw new UnexpectedValueException(sprintf( + 'Enum %s has no value defined for name %s', __CLASS__, $name)); + } + return constant($const); + } +} +