Skip to content

Commit

Permalink
feat(documentai): update the api
Browse files Browse the repository at this point in the history
#### documentai:v1

The following keys were added:
- schemas.GoogleCloudDocumentaiV1DocumentOutputConfigGcsOutputConfig.properties.shardingConfig.$ref (Total Keys: 1)
- schemas.GoogleCloudDocumentaiV1DocumentOutputConfigGcsOutputConfigShardingConfig (Total Keys: 6)
- schemas.GoogleCloudDocumentaiV1ProcessorType.properties.sampleDocumentUris (Total Keys: 2)

#### documentai:v1beta3

The following keys were added:
- schemas.GoogleCloudDocumentaiV1beta3BatchProcessRequest.properties.processOptions.$ref (Total Keys: 1)
- schemas.GoogleCloudDocumentaiV1beta3DocumentOutputConfigGcsOutputConfig.properties.shardingConfig.$ref (Total Keys: 1)
- schemas.GoogleCloudDocumentaiV1beta3DocumentOutputConfigGcsOutputConfigShardingConfig (Total Keys: 6)
- schemas.GoogleCloudDocumentaiV1beta3OcrConfig (Total Keys: 3)
- schemas.GoogleCloudDocumentaiV1beta3ProcessOptions (Total Keys: 3)
- schemas.GoogleCloudDocumentaiV1beta3ProcessRequest.properties.processOptions.$ref (Total Keys: 1)
- schemas.GoogleCloudDocumentaiV1beta3ProcessorType.properties.sampleDocumentUris (Total Keys: 2)
  • Loading branch information
yoshi-automation committed Dec 13, 2022
1 parent 952d0d1 commit 9e0a260
Show file tree
Hide file tree
Showing 15 changed files with 239 additions and 105 deletions.
3 changes: 3 additions & 0 deletions docs/dyn/documentai_v1.projects.locations.html
Expand Up @@ -136,6 +136,9 @@ <h3>Method Details</h3>
&quot;category&quot;: &quot;A String&quot;, # The processor category, used by UI to group processor types.
&quot;launchStage&quot;: &quot;A String&quot;, # Launch stage of the processor type
&quot;name&quot;: &quot;A String&quot;, # The resource name of the processor type. Format: `projects/{project}/processorTypes/{processor_type}`
&quot;sampleDocumentUris&quot;: [ # A set of Cloud Storage URIs of sample documents for this processor.
&quot;A String&quot;,
],
&quot;type&quot;: &quot;A String&quot;, # The processor type, e.g., `OCR_PROCESSOR`, `INVOICE_PROCESSOR`, etc.
},
],
Expand Down
3 changes: 3 additions & 0 deletions docs/dyn/documentai_v1.projects.locations.processorTypes.html
Expand Up @@ -118,6 +118,9 @@ <h3>Method Details</h3>
&quot;category&quot;: &quot;A String&quot;, # The processor category, used by UI to group processor types.
&quot;launchStage&quot;: &quot;A String&quot;, # Launch stage of the processor type
&quot;name&quot;: &quot;A String&quot;, # The resource name of the processor type. Format: `projects/{project}/processorTypes/{processor_type}`
&quot;sampleDocumentUris&quot;: [ # A set of Cloud Storage URIs of sample documents for this processor.
&quot;A String&quot;,
],
&quot;type&quot;: &quot;A String&quot;, # The processor type, e.g., `OCR_PROCESSOR`, `INVOICE_PROCESSOR`, etc.
},
],
Expand Down
20 changes: 12 additions & 8 deletions docs/dyn/documentai_v1.projects.locations.processors.html

Large diffs are not rendered by default.

Expand Up @@ -110,7 +110,7 @@ <h3>Method Details</h3>
&quot;A String&quot;,
],
},
&quot;name&quot;: &quot;A String&quot;, # Name of the type. It must be unique within the schema file and cannot be a &#x27;Common Type&#x27;. Besides that we use the following naming conventions: - *use `snake_casing`* - name matching is case-insensitive - Maximum 64 characters. - Must start with a letter. - Allowed characters: ASCII letters `[a-z0-9_-]`. (For backward compatibility internal infrastructure and tooling can handle any ascii character) - The `/` is sometimes used to denote a property of a type. For example `line_item/amount`. This convention is deprecated, but will still be honored for backward compatibility.
&quot;name&quot;: &quot;A String&quot;, # Name of the type. It must be unique within the schema file and cannot be a &#x27;Common Type&#x27;. Besides that we use the following naming conventions: - *use `snake_casing`* - name matching is case-sensitive - Maximum 64 characters. - Must start with a letter. - Allowed characters: ASCII letters `[a-z0-9_-]`. (For backward compatibility internal infrastructure and tooling can handle any ascii character) - The `/` is sometimes used to denote a property of a type. For example `line_item/amount`. This convention is deprecated, but will still be honored for backward compatibility.
&quot;properties&quot;: [ # Describing the nested structure, or composition of an entity.
{ # Defines properties that can be part of the entity type.
&quot;name&quot;: &quot;A String&quot;, # The name of the property. Follows the same guidelines as the EntityType name.
Expand Down Expand Up @@ -181,7 +181,7 @@ <h3>Method Details</h3>
&quot;nanos&quot;: 42, # Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000.
&quot;units&quot;: &quot;A String&quot;, # The whole units of the amount. For example if `currencyCode` is `&quot;USD&quot;`, then 1 unit is one US dollar.
},
&quot;text&quot;: &quot;A String&quot;, # Optional. An optional field to store a normalized string. For some entity types, one of respective `structured_value` fields may also be populated. Also not all the types of `structured_value` will be normalized. For example, some processors may not generate float or int normalized text by default. Below are sample formats mapped to structured values. - Money/Currency type (`money_value`) is in the ISO 4217 text format. - Date type (`date_value`) is in the ISO 8601 text format. - Datetime type (`datetime_value`) is in the ISO 8601 text format.
&quot;text&quot;: &quot;A String&quot;, # Optional. An optional field to store a normalized string. For some entity types, one of respective `structured_value` fields may also be populated. Also not all the types of `structured_value` will be normalized. For example, some processors may not generate `float` or `integer` normalized text by default. Below are sample formats mapped to structured values. - Money/Currency type (`money_value`) is in the ISO 4217 text format. - Date type (`date_value`) is in the ISO 8601 text format. - Datetime type (`datetime_value`) is in the ISO 8601 text format.
},
&quot;pageAnchor&quot;: { # Referencing the visual context of the entity in the Document.pages. Page anchors can be cross-page, consist of multiple bounding polygons and optionally reference specific layout element types. # Optional. Represents the provenance of this entity wrt. the location on the page where it was found.
&quot;pageRefs&quot;: [ # One or more references to visual page elements
Expand All @@ -203,7 +203,7 @@ <h3>Method Details</h3>
&quot;confidence&quot;: 3.14, # Optional. Confidence of detected page element, if applicable. Range `[0, 1]`.
&quot;layoutId&quot;: &quot;A String&quot;, # Optional. Deprecated. Use PageRef.bounding_poly instead.
&quot;layoutType&quot;: &quot;A String&quot;, # Optional. The type of the layout element that is being referenced if any.
&quot;page&quot;: &quot;A String&quot;, # Required. Index into the Document.pages element, for example using Document.pages to locate the related page element. This field is skipped when its value is the default 0. See https://developers.google.com/protocol-buffers/docs/proto3#json.
&quot;page&quot;: &quot;A String&quot;, # Required. Index into the Document.pages element, for example using `Document.pages` to locate the related page element. This field is skipped when its value is the default `0`. See https://developers.google.com/protocol-buffers/docs/proto3#json.
},
],
},
Expand Down Expand Up @@ -432,7 +432,7 @@ <h3>Method Details</h3>
&quot;languageCode&quot;: &quot;A String&quot;, # The BCP-47 language code, such as `en-US` or `sr-Latn`. For more information, see https://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
},
],
&quot;valueType&quot;: &quot;A String&quot;, # If the value is non-textual, this field represents the type. Current valid values are: - blank (this indicates the field_value is normal text) - &quot;unfilled_checkbox&quot; - &quot;filled_checkbox&quot;
&quot;valueType&quot;: &quot;A String&quot;, # If the value is non-textual, this field represents the type. Current valid values are: - blank (this indicates the `field_value` is normal text) - `unfilled_checkbox` - `filled_checkbox`
},
],
&quot;image&quot;: { # Rendered image contents for this page. # Rendered image for this page. This image is preprocessed to remove any skew, rotation, and distortions such that the annotation bounding boxes can be upright and axis-aligned.
Expand Down Expand Up @@ -912,7 +912,7 @@ <h3>Method Details</h3>
},
},
],
&quot;textStyles&quot;: [ # Placeholder. Styles for the Document.text.
&quot;textStyles&quot;: [ # Styles for the Document.text.
{ # Annotation for common text style attributes. This adheres to CSS conventions as much as possible.
&quot;backgroundColor&quot;: { # Represents a color in the RGBA color space. This representation is designed for simplicity of conversion to/from color representations in various languages over compactness. For example, the fields of this representation can be trivially provided to the constructor of `java.awt.Color` in Java; it can also be trivially provided to UIColor&#x27;s `+colorWithRed:green:blue:alpha` method in iOS; and, with just a little work, it can be easily formatted into a CSS `rgba()` string in JavaScript. This reference page doesn&#x27;t carry information about the absolute color space that should be used to interpret the RGB value (e.g. sRGB, Adobe RGB, DCI-P3, BT.2020, etc.). By default, applications should assume the sRGB color space. When color equality needs to be decided, implementations, unless documented otherwise, treat two colors as equal if all their red, green, blue, and alpha values each differ by at most 1e-5. Example (Java): import com.google.type.Color; // ... public static java.awt.Color fromProto(Color protocolor) { float alpha = protocolor.hasAlpha() ? protocolor.getAlpha().getValue() : 1.0; return new java.awt.Color( protocolor.getRed(), protocolor.getGreen(), protocolor.getBlue(), alpha); } public static Color toProto(java.awt.Color color) { float red = (float) color.getRed(); float green = (float) color.getGreen(); float blue = (float) color.getBlue(); float denominator = 255.0; Color.Builder resultBuilder = Color .newBuilder() .setRed(red / denominator) .setGreen(green / denominator) .setBlue(blue / denominator); int alpha = color.getAlpha(); if (alpha != 255) { result.setAlpha( FloatValue .newBuilder() .setValue(((float) alpha) / denominator) .build()); } return resultBuilder.build(); } // ... Example (iOS / Obj-C): // ... static UIColor* fromProto(Color* protocolor) { float red = [protocolor red]; float green = [protocolor green]; float blue = [protocolor blue]; FloatValue* alpha_wrapper = [protocolor alpha]; float alpha = 1.0; if (alpha_wrapper != nil) { alpha = [alpha_wrapper value]; } return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; } static Color* toProto(UIColor* color) { CGFloat red, green, blue, alpha; if (![color getRed:&amp;red green:&amp;green blue:&amp;blue alpha:&amp;alpha]) { return nil; } Color* result = [[Color alloc] init]; [result setRed:red]; [result setGreen:green]; [result setBlue:blue]; if (alpha &lt;= 0.9999) { [result setAlpha:floatWrapperWithValue(alpha)]; } [result autorelease]; return result; } // ... Example (JavaScript): // ... var protoToCssColor = function(rgb_color) { var redFrac = rgb_color.red || 0.0; var greenFrac = rgb_color.green || 0.0; var blueFrac = rgb_color.blue || 0.0; var red = Math.floor(redFrac * 255); var green = Math.floor(greenFrac * 255); var blue = Math.floor(blueFrac * 255); if (!(&#x27;alpha&#x27; in rgb_color)) { return rgbToCssColor(red, green, blue); } var alphaFrac = rgb_color.alpha.value || 0.0; var rgbParams = [red, green, blue].join(&#x27;,&#x27;); return [&#x27;rgba(&#x27;, rgbParams, &#x27;,&#x27;, alphaFrac, &#x27;)&#x27;].join(&#x27;&#x27;); }; var rgbToCssColor = function(red, green, blue) { var rgbNumber = new Number((red &lt;&lt; 16) | (green &lt;&lt; 8) | blue); var hexString = rgbNumber.toString(16); var missingZeros = 6 - hexString.length; var resultBuilder = [&#x27;#&#x27;]; for (var i = 0; i &lt; missingZeros; i++) { resultBuilder.push(&#x27;0&#x27;); } resultBuilder.push(hexString); return resultBuilder.join(&#x27;&#x27;); }; // ... # Text background color.
&quot;alpha&quot;: 3.14, # The fraction of this color that should be applied to the pixel. That is, the final pixel color is defined by the equation: `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` This means that a value of 1.0 corresponds to a solid color, whereas a value of 0.0 corresponds to a completely transparent color. This uses a wrapper message rather than a simple float scalar so that it is possible to distinguish between a default value and the value being unset. If omitted, this color object is rendered as a solid color (as if the alpha value had been explicitly given a value of 1.0).
Expand Down

0 comments on commit 9e0a260

Please sign in to comment.