diff --git a/docs/build/doctrees/adobe.doctree b/docs/build/doctrees/adobe.doctree index 5a0de54..a59348c 100644 Binary files a/docs/build/doctrees/adobe.doctree and b/docs/build/doctrees/adobe.doctree differ diff --git a/docs/build/doctrees/adobe.pdfservices.doctree b/docs/build/doctrees/adobe.pdfservices.doctree index da8e33f..8c0a7a5 100644 Binary files a/docs/build/doctrees/adobe.pdfservices.doctree and b/docs/build/doctrees/adobe.pdfservices.doctree differ diff --git a/docs/build/doctrees/adobe.pdfservices.operation.auth.doctree b/docs/build/doctrees/adobe.pdfservices.operation.auth.doctree index f52a385..69fa0eb 100644 Binary files a/docs/build/doctrees/adobe.pdfservices.operation.auth.doctree and b/docs/build/doctrees/adobe.pdfservices.operation.auth.doctree differ diff --git a/docs/build/doctrees/adobe.pdfservices.operation.doctree b/docs/build/doctrees/adobe.pdfservices.operation.doctree index 52a7adf..5028490 100644 Binary files a/docs/build/doctrees/adobe.pdfservices.operation.doctree and b/docs/build/doctrees/adobe.pdfservices.operation.doctree differ diff --git a/docs/build/doctrees/adobe.pdfservices.operation.exception.doctree b/docs/build/doctrees/adobe.pdfservices.operation.exception.doctree index 9d5d359..ee9d7b8 100644 Binary files a/docs/build/doctrees/adobe.pdfservices.operation.exception.doctree and b/docs/build/doctrees/adobe.pdfservices.operation.exception.doctree differ diff --git a/docs/build/doctrees/adobe.pdfservices.operation.io.doctree b/docs/build/doctrees/adobe.pdfservices.operation.io.doctree index affec6a..7cf5461 100644 Binary files a/docs/build/doctrees/adobe.pdfservices.operation.io.doctree and b/docs/build/doctrees/adobe.pdfservices.operation.io.doctree differ diff --git a/docs/build/doctrees/adobe.pdfservices.operation.pdfops.doctree b/docs/build/doctrees/adobe.pdfservices.operation.pdfops.doctree index 54abb50..41a9c53 100644 Binary files a/docs/build/doctrees/adobe.pdfservices.operation.pdfops.doctree and b/docs/build/doctrees/adobe.pdfservices.operation.pdfops.doctree differ diff --git a/docs/build/doctrees/adobe.pdfservices.operation.pdfops.options.doctree b/docs/build/doctrees/adobe.pdfservices.operation.pdfops.options.doctree index f6d35c8..b471d45 100644 Binary files a/docs/build/doctrees/adobe.pdfservices.operation.pdfops.options.doctree and b/docs/build/doctrees/adobe.pdfservices.operation.pdfops.options.doctree differ diff --git a/docs/build/doctrees/adobe.pdfservices.operation.pdfops.options.extractpdf.doctree b/docs/build/doctrees/adobe.pdfservices.operation.pdfops.options.extractpdf.doctree index d6f13ef..4fbdf02 100644 Binary files a/docs/build/doctrees/adobe.pdfservices.operation.pdfops.options.extractpdf.doctree and b/docs/build/doctrees/adobe.pdfservices.operation.pdfops.options.extractpdf.doctree differ diff --git a/docs/build/doctrees/environment.pickle b/docs/build/doctrees/environment.pickle index c39d0fd..ac25958 100644 Binary files a/docs/build/doctrees/environment.pickle and b/docs/build/doctrees/environment.pickle differ diff --git a/docs/build/doctrees/index.doctree b/docs/build/doctrees/index.doctree index a1497b7..8c28207 100644 Binary files a/docs/build/doctrees/index.doctree and b/docs/build/doctrees/index.doctree differ diff --git a/docs/build/doctrees/modules.doctree b/docs/build/doctrees/modules.doctree index d036a00..97248f5 100644 Binary files a/docs/build/doctrees/modules.doctree and b/docs/build/doctrees/modules.doctree differ diff --git a/docs/build/doctrees/reference/index.doctree b/docs/build/doctrees/reference/index.doctree index a188403..01bc5b7 100644 Binary files a/docs/build/doctrees/reference/index.doctree and b/docs/build/doctrees/reference/index.doctree differ diff --git a/docs/build/html/.buildinfo b/docs/build/html/.buildinfo index b405a1f..62ade7c 100644 --- a/docs/build/html/.buildinfo +++ b/docs/build/html/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: f5a268b1476d9649e6c21de12718916e +config: 5a4c3b86d3c73856c73b6ffb54655fd5 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/build/html/_static/basic.css b/docs/build/html/_static/basic.css index be19270..bf18350 100644 --- a/docs/build/html/_static/basic.css +++ b/docs/build/html/_static/basic.css @@ -4,7 +4,7 @@ * * Sphinx stylesheet -- basic theme. * - * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -130,7 +130,7 @@ ul.search li a { font-weight: bold; } -ul.search li div.context { +ul.search li p.context { color: #888; margin: 2px 0 0 30px; text-align: left; @@ -277,25 +277,25 @@ p.rubric { font-weight: bold; } -img.align-left, .figure.align-left, object.align-left { +img.align-left, figure.align-left, .figure.align-left, object.align-left { clear: left; float: left; margin-right: 1em; } -img.align-right, .figure.align-right, object.align-right { +img.align-right, figure.align-right, .figure.align-right, object.align-right { clear: right; float: right; margin-left: 1em; } -img.align-center, .figure.align-center, object.align-center { +img.align-center, figure.align-center, .figure.align-center, object.align-center { display: block; margin-left: auto; margin-right: auto; } -img.align-default, .figure.align-default { +img.align-default, figure.align-default, .figure.align-default { display: block; margin-left: auto; margin-right: auto; @@ -319,7 +319,8 @@ img.align-default, .figure.align-default { /* -- sidebars -------------------------------------------------------------- */ -div.sidebar { +div.sidebar, +aside.sidebar { margin: 0 0 0.5em 1em; border: 1px solid #ddb; padding: 7px; @@ -377,12 +378,14 @@ div.body p.centered { /* -- content of sidebars/topics/admonitions -------------------------------- */ div.sidebar > :last-child, +aside.sidebar > :last-child, div.topic > :last-child, div.admonition > :last-child { margin-bottom: 0; } div.sidebar::after, +aside.sidebar::after, div.topic::after, div.admonition::after, blockquote::after { @@ -455,20 +458,22 @@ td > :last-child { /* -- figures --------------------------------------------------------------- */ -div.figure { +div.figure, figure { margin: 0.5em; padding: 0.5em; } -div.figure p.caption { +div.figure p.caption, figcaption { padding: 0.3em; } -div.figure p.caption span.caption-number { +div.figure p.caption span.caption-number, +figcaption span.caption-number { font-style: italic; } -div.figure p.caption span.caption-text { +div.figure p.caption span.caption-text, +figcaption span.caption-text { } /* -- field list styles ----------------------------------------------------- */ @@ -503,6 +508,63 @@ table.hlist td { vertical-align: top; } +/* -- object description styles --------------------------------------------- */ + +.sig { + font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; +} + +.sig-name, code.descname { + background-color: transparent; + font-weight: bold; +} + +.sig-name { + font-size: 1.1em; +} + +code.descname { + font-size: 1.2em; +} + +.sig-prename, code.descclassname { + background-color: transparent; +} + +.optional { + font-size: 1.3em; +} + +.sig-paren { + font-size: larger; +} + +.sig-param.n { + font-style: italic; +} + +/* C++ specific styling */ + +.sig-inline.c-texpr, +.sig-inline.cpp-texpr { + font-family: unset; +} + +.sig.c .k, .sig.c .kt, +.sig.cpp .k, .sig.cpp .kt { + color: #0033B3; +} + +.sig.c .m, +.sig.cpp .m { + color: #1750EB; +} + +.sig.c .s, .sig.c .sc, +.sig.cpp .s, .sig.cpp .sc { + color: #067D17; +} + /* -- other body styles ----------------------------------------------------- */ @@ -629,14 +691,6 @@ dl.glossary dt { font-size: 1.1em; } -.optional { - font-size: 1.3em; -} - -.sig-paren { - font-size: larger; -} - .versionmodified { font-style: italic; } @@ -677,8 +731,9 @@ dl.glossary dt { .classifier:before { font-style: normal; - margin: 0.5em; + margin: 0 0.5em; content: ":"; + display: inline-block; } abbr, acronym { @@ -702,6 +757,7 @@ span.pre { -ms-hyphens: none; -webkit-hyphens: none; hyphens: none; + white-space: nowrap; } div[class*="highlight-"] { @@ -765,8 +821,12 @@ div.code-block-caption code { table.highlighttable td.linenos, span.linenos, -div.doctest > div.highlight span.gp { /* gp: Generic.Prompt */ - user-select: none; +div.highlight span.gp { /* gp: Generic.Prompt */ + user-select: none; + -webkit-user-select: text; /* Safari fallback only */ + -webkit-user-select: none; /* Chrome/Safari */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* IE10+ */ } div.code-block-caption span.caption-number { @@ -781,16 +841,6 @@ div.literal-block-wrapper { margin: 1em 0; } -code.descname { - background-color: transparent; - font-weight: bold; - font-size: 1.2em; -} - -code.descclassname { - background-color: transparent; -} - code.xref, a code { background-color: transparent; font-weight: bold; diff --git a/docs/build/html/_static/doctools.js b/docs/build/html/_static/doctools.js index 144884e..e509e48 100644 --- a/docs/build/html/_static/doctools.js +++ b/docs/build/html/_static/doctools.js @@ -4,7 +4,7 @@ * * Sphinx JavaScript utilities for all documentation. * - * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -29,9 +29,14 @@ if (!window.console || !console.firebug) { /** * small helper function to urldecode strings + * + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL */ jQuery.urldecode = function(x) { - return decodeURIComponent(x).replace(/\+/g, ' '); + if (!x) { + return x + } + return decodeURIComponent(x.replace(/\+/g, ' ')); }; /** @@ -259,6 +264,9 @@ var Documentation = { hideSearchWords : function() { $('#searchbox .highlight-link').fadeOut(300); $('span.highlighted').removeClass('highlighted'); + var url = new URL(window.location); + url.searchParams.delete('highlight'); + window.history.replaceState({}, '', url); }, /** @@ -296,12 +304,14 @@ var Documentation = { window.location.href = prevHref; return false; } + break; case 39: // right var nextHref = $('link[rel="next"]').prop('href'); if (nextHref) { window.location.href = nextHref; return false; } + break; } } }); diff --git a/docs/build/html/_static/language_data.js b/docs/build/html/_static/language_data.js index 0e7dc7e..ebe2f03 100644 --- a/docs/build/html/_static/language_data.js +++ b/docs/build/html/_static/language_data.js @@ -5,7 +5,7 @@ * This script contains the language-specific data used by searchtools.js, * namely the list of stopwords, stemmer, scorer and splitter. * - * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -13,7 +13,8 @@ var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"]; -/* Non-minified version JS is _stemmer.js if file is provided */ +/* Non-minified version is copied as a separate JS file, is available */ + /** * Porter Stemmer */ @@ -199,7 +200,6 @@ var Stemmer = function() { - var splitChars = (function() { var result = {}; var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648, diff --git a/docs/build/html/_static/searchtools.js b/docs/build/html/_static/searchtools.js index 6fc9e7f..2d77859 100644 --- a/docs/build/html/_static/searchtools.js +++ b/docs/build/html/_static/searchtools.js @@ -4,7 +4,7 @@ * * Sphinx JavaScript utilities for the full-text search. * - * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2022 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -248,7 +248,7 @@ var Search = { // results left, load the summary and display it if (results.length) { var item = results.pop(); - var listItem = $('
  • '); + var listItem = $('
  • '); var requestUrl = ""; var linkUrl = ""; if (DOCUMENTATION_OPTIONS.BUILDER === 'dirhtml') { @@ -273,28 +273,31 @@ var Search = { if (item[3]) { listItem.append($(' (' + item[3] + ')')); Search.output.append(listItem); - listItem.slideDown(5, function() { + setTimeout(function() { displayNextItem(); - }); + }, 5); } else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) { $.ajax({url: requestUrl, dataType: "text", complete: function(jqxhr, textstatus) { var data = jqxhr.responseText; if (data !== '' && data !== undefined) { - listItem.append(Search.makeSearchSummary(data, searchterms, hlterms)); + var summary = Search.makeSearchSummary(data, searchterms, hlterms); + if (summary) { + listItem.append(summary); + } } Search.output.append(listItem); - listItem.slideDown(5, function() { + setTimeout(function() { displayNextItem(); - }); + }, 5); }}); } else { // no source available, just display title Search.output.append(listItem); - listItem.slideDown(5, function() { + setTimeout(function() { displayNextItem(); - }); + }, 5); } } // search finished, update title and status message @@ -325,7 +328,9 @@ var Search = { var results = []; for (var prefix in objects) { - for (var name in objects[prefix]) { + for (var iMatch = 0; iMatch != objects[prefix].length; ++iMatch) { + var match = objects[prefix][iMatch]; + var name = match[4]; var fullname = (prefix ? prefix + '.' : '') + name; var fullnameLower = fullname.toLowerCase() if (fullnameLower.indexOf(object) > -1) { @@ -339,7 +344,6 @@ var Search = { } else if (parts[parts.length - 1].indexOf(object) > -1) { score += Scorer.objPartialMatch; } - var match = objects[prefix][name]; var objname = objnames[match[1]][2]; var title = titles[match[0]]; // If more than one term searched for, we require other words to be @@ -379,6 +383,13 @@ var Search = { return results; }, + /** + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions + */ + escapeRegExp : function(string) { + return string.replace(/[.*+\-?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string + }, + /** * search for full-text terms in the index */ @@ -402,13 +413,14 @@ var Search = { ]; // add support for partial matches if (word.length > 2) { + var word_regex = this.escapeRegExp(word); for (var w in terms) { - if (w.match(word) && !terms[word]) { + if (w.match(word_regex) && !terms[word]) { _o.push({files: terms[w], score: Scorer.partialTerm}) } } for (var w in titleterms) { - if (w.match(word) && !titleterms[word]) { + if (w.match(word_regex) && !titleterms[word]) { _o.push({files: titleterms[w], score: Scorer.partialTitle}) } } @@ -490,6 +502,9 @@ var Search = { */ makeSearchSummary : function(htmlText, keywords, hlwords) { var text = Search.htmlToText(htmlText); + if (text == "") { + return null; + } var textLower = text.toLowerCase(); var start = 0; $.each(keywords, function() { @@ -501,7 +516,7 @@ var Search = { var excerpt = ((start > 0) ? '...' : '') + $.trim(text.substr(start, 240)) + ((start + 240 - text.length) ? '...' : ''); - var rv = $('
    ').text(excerpt); + var rv = $('

    ').text(excerpt); $.each(hlwords, function() { rv = rv.highlightText(this, 'highlighted'); }); diff --git a/docs/build/html/_static/underscore-1.13.1.js b/docs/build/html/_static/underscore-1.13.1.js new file mode 100644 index 0000000..ffd77af --- /dev/null +++ b/docs/build/html/_static/underscore-1.13.1.js @@ -0,0 +1,2042 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define('underscore', factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (function () { + var current = global._; + var exports = global._ = factory(); + exports.noConflict = function () { global._ = current; return exports; }; + }())); +}(this, (function () { + // Underscore.js 1.13.1 + // https://underscorejs.org + // (c) 2009-2021 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors + // Underscore may be freely distributed under the MIT license. + + // Current version. + var VERSION = '1.13.1'; + + // Establish the root object, `window` (`self`) in the browser, `global` + // on the server, or `this` in some virtual machines. We use `self` + // instead of `window` for `WebWorker` support. + var root = typeof self == 'object' && self.self === self && self || + typeof global == 'object' && global.global === global && global || + Function('return this')() || + {}; + + // Save bytes in the minified (but not gzipped) version: + var ArrayProto = Array.prototype, ObjProto = Object.prototype; + var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null; + + // Create quick reference variables for speed access to core prototypes. + var push = ArrayProto.push, + slice = ArrayProto.slice, + toString = ObjProto.toString, + hasOwnProperty = ObjProto.hasOwnProperty; + + // Modern feature detection. + var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined', + supportsDataView = typeof DataView !== 'undefined'; + + // All **ECMAScript 5+** native function implementations that we hope to use + // are declared here. + var nativeIsArray = Array.isArray, + nativeKeys = Object.keys, + nativeCreate = Object.create, + nativeIsView = supportsArrayBuffer && ArrayBuffer.isView; + + // Create references to these builtin functions because we override them. + var _isNaN = isNaN, + _isFinite = isFinite; + + // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed. + var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString'); + var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString', + 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString']; + + // The largest integer that can be represented exactly. + var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1; + + // Some functions take a variable number of arguments, or a few expected + // arguments at the beginning and then a variable number of values to operate + // on. This helper accumulates all remaining arguments past the function’s + // argument length (or an explicit `startIndex`), into an array that becomes + // the last argument. Similar to ES6’s "rest parameter". + function restArguments(func, startIndex) { + startIndex = startIndex == null ? func.length - 1 : +startIndex; + return function() { + var length = Math.max(arguments.length - startIndex, 0), + rest = Array(length), + index = 0; + for (; index < length; index++) { + rest[index] = arguments[index + startIndex]; + } + switch (startIndex) { + case 0: return func.call(this, rest); + case 1: return func.call(this, arguments[0], rest); + case 2: return func.call(this, arguments[0], arguments[1], rest); + } + var args = Array(startIndex + 1); + for (index = 0; index < startIndex; index++) { + args[index] = arguments[index]; + } + args[startIndex] = rest; + return func.apply(this, args); + }; + } + + // Is a given variable an object? + function isObject(obj) { + var type = typeof obj; + return type === 'function' || type === 'object' && !!obj; + } + + // Is a given value equal to null? + function isNull(obj) { + return obj === null; + } + + // Is a given variable undefined? + function isUndefined(obj) { + return obj === void 0; + } + + // Is a given value a boolean? + function isBoolean(obj) { + return obj === true || obj === false || toString.call(obj) === '[object Boolean]'; + } + + // Is a given value a DOM element? + function isElement(obj) { + return !!(obj && obj.nodeType === 1); + } + + // Internal function for creating a `toString`-based type tester. + function tagTester(name) { + var tag = '[object ' + name + ']'; + return function(obj) { + return toString.call(obj) === tag; + }; + } + + var isString = tagTester('String'); + + var isNumber = tagTester('Number'); + + var isDate = tagTester('Date'); + + var isRegExp = tagTester('RegExp'); + + var isError = tagTester('Error'); + + var isSymbol = tagTester('Symbol'); + + var isArrayBuffer = tagTester('ArrayBuffer'); + + var isFunction = tagTester('Function'); + + // Optimize `isFunction` if appropriate. Work around some `typeof` bugs in old + // v8, IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236). + var nodelist = root.document && root.document.childNodes; + if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') { + isFunction = function(obj) { + return typeof obj == 'function' || false; + }; + } + + var isFunction$1 = isFunction; + + var hasObjectTag = tagTester('Object'); + + // In IE 10 - Edge 13, `DataView` has string tag `'[object Object]'`. + // In IE 11, the most common among them, this problem also applies to + // `Map`, `WeakMap` and `Set`. + var hasStringTagBug = ( + supportsDataView && hasObjectTag(new DataView(new ArrayBuffer(8))) + ), + isIE11 = (typeof Map !== 'undefined' && hasObjectTag(new Map)); + + var isDataView = tagTester('DataView'); + + // In IE 10 - Edge 13, we need a different heuristic + // to determine whether an object is a `DataView`. + function ie10IsDataView(obj) { + return obj != null && isFunction$1(obj.getInt8) && isArrayBuffer(obj.buffer); + } + + var isDataView$1 = (hasStringTagBug ? ie10IsDataView : isDataView); + + // Is a given value an array? + // Delegates to ECMA5's native `Array.isArray`. + var isArray = nativeIsArray || tagTester('Array'); + + // Internal function to check whether `key` is an own property name of `obj`. + function has$1(obj, key) { + return obj != null && hasOwnProperty.call(obj, key); + } + + var isArguments = tagTester('Arguments'); + + // Define a fallback version of the method in browsers (ahem, IE < 9), where + // there isn't any inspectable "Arguments" type. + (function() { + if (!isArguments(arguments)) { + isArguments = function(obj) { + return has$1(obj, 'callee'); + }; + } + }()); + + var isArguments$1 = isArguments; + + // Is a given object a finite number? + function isFinite$1(obj) { + return !isSymbol(obj) && _isFinite(obj) && !isNaN(parseFloat(obj)); + } + + // Is the given value `NaN`? + function isNaN$1(obj) { + return isNumber(obj) && _isNaN(obj); + } + + // Predicate-generating function. Often useful outside of Underscore. + function constant(value) { + return function() { + return value; + }; + } + + // Common internal logic for `isArrayLike` and `isBufferLike`. + function createSizePropertyCheck(getSizeProperty) { + return function(collection) { + var sizeProperty = getSizeProperty(collection); + return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= MAX_ARRAY_INDEX; + } + } + + // Internal helper to generate a function to obtain property `key` from `obj`. + function shallowProperty(key) { + return function(obj) { + return obj == null ? void 0 : obj[key]; + }; + } + + // Internal helper to obtain the `byteLength` property of an object. + var getByteLength = shallowProperty('byteLength'); + + // Internal helper to determine whether we should spend extensive checks against + // `ArrayBuffer` et al. + var isBufferLike = createSizePropertyCheck(getByteLength); + + // Is a given value a typed array? + var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/; + function isTypedArray(obj) { + // `ArrayBuffer.isView` is the most future-proof, so use it when available. + // Otherwise, fall back on the above regular expression. + return nativeIsView ? (nativeIsView(obj) && !isDataView$1(obj)) : + isBufferLike(obj) && typedArrayPattern.test(toString.call(obj)); + } + + var isTypedArray$1 = supportsArrayBuffer ? isTypedArray : constant(false); + + // Internal helper to obtain the `length` property of an object. + var getLength = shallowProperty('length'); + + // Internal helper to create a simple lookup structure. + // `collectNonEnumProps` used to depend on `_.contains`, but this led to + // circular imports. `emulatedSet` is a one-off solution that only works for + // arrays of strings. + function emulatedSet(keys) { + var hash = {}; + for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true; + return { + contains: function(key) { return hash[key]; }, + push: function(key) { + hash[key] = true; + return keys.push(key); + } + }; + } + + // Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't + // be iterated by `for key in ...` and thus missed. Extends `keys` in place if + // needed. + function collectNonEnumProps(obj, keys) { + keys = emulatedSet(keys); + var nonEnumIdx = nonEnumerableProps.length; + var constructor = obj.constructor; + var proto = isFunction$1(constructor) && constructor.prototype || ObjProto; + + // Constructor is a special case. + var prop = 'constructor'; + if (has$1(obj, prop) && !keys.contains(prop)) keys.push(prop); + + while (nonEnumIdx--) { + prop = nonEnumerableProps[nonEnumIdx]; + if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) { + keys.push(prop); + } + } + } + + // Retrieve the names of an object's own properties. + // Delegates to **ECMAScript 5**'s native `Object.keys`. + function keys(obj) { + if (!isObject(obj)) return []; + if (nativeKeys) return nativeKeys(obj); + var keys = []; + for (var key in obj) if (has$1(obj, key)) keys.push(key); + // Ahem, IE < 9. + if (hasEnumBug) collectNonEnumProps(obj, keys); + return keys; + } + + // Is a given array, string, or object empty? + // An "empty" object has no enumerable own-properties. + function isEmpty(obj) { + if (obj == null) return true; + // Skip the more expensive `toString`-based type checks if `obj` has no + // `.length`. + var length = getLength(obj); + if (typeof length == 'number' && ( + isArray(obj) || isString(obj) || isArguments$1(obj) + )) return length === 0; + return getLength(keys(obj)) === 0; + } + + // Returns whether an object has a given set of `key:value` pairs. + function isMatch(object, attrs) { + var _keys = keys(attrs), length = _keys.length; + if (object == null) return !length; + var obj = Object(object); + for (var i = 0; i < length; i++) { + var key = _keys[i]; + if (attrs[key] !== obj[key] || !(key in obj)) return false; + } + return true; + } + + // If Underscore is called as a function, it returns a wrapped object that can + // be used OO-style. This wrapper holds altered versions of all functions added + // through `_.mixin`. Wrapped objects may be chained. + function _$1(obj) { + if (obj instanceof _$1) return obj; + if (!(this instanceof _$1)) return new _$1(obj); + this._wrapped = obj; + } + + _$1.VERSION = VERSION; + + // Extracts the result from a wrapped and chained object. + _$1.prototype.value = function() { + return this._wrapped; + }; + + // Provide unwrapping proxies for some methods used in engine operations + // such as arithmetic and JSON stringification. + _$1.prototype.valueOf = _$1.prototype.toJSON = _$1.prototype.value; + + _$1.prototype.toString = function() { + return String(this._wrapped); + }; + + // Internal function to wrap or shallow-copy an ArrayBuffer, + // typed array or DataView to a new view, reusing the buffer. + function toBufferView(bufferSource) { + return new Uint8Array( + bufferSource.buffer || bufferSource, + bufferSource.byteOffset || 0, + getByteLength(bufferSource) + ); + } + + // We use this string twice, so give it a name for minification. + var tagDataView = '[object DataView]'; + + // Internal recursive comparison function for `_.isEqual`. + function eq(a, b, aStack, bStack) { + // Identical objects are equal. `0 === -0`, but they aren't identical. + // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal). + if (a === b) return a !== 0 || 1 / a === 1 / b; + // `null` or `undefined` only equal to itself (strict comparison). + if (a == null || b == null) return false; + // `NaN`s are equivalent, but non-reflexive. + if (a !== a) return b !== b; + // Exhaust primitive checks + var type = typeof a; + if (type !== 'function' && type !== 'object' && typeof b != 'object') return false; + return deepEq(a, b, aStack, bStack); + } + + // Internal recursive comparison function for `_.isEqual`. + function deepEq(a, b, aStack, bStack) { + // Unwrap any wrapped objects. + if (a instanceof _$1) a = a._wrapped; + if (b instanceof _$1) b = b._wrapped; + // Compare `[[Class]]` names. + var className = toString.call(a); + if (className !== toString.call(b)) return false; + // Work around a bug in IE 10 - Edge 13. + if (hasStringTagBug && className == '[object Object]' && isDataView$1(a)) { + if (!isDataView$1(b)) return false; + className = tagDataView; + } + switch (className) { + // These types are compared by value. + case '[object RegExp]': + // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') + case '[object String]': + // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is + // equivalent to `new String("5")`. + return '' + a === '' + b; + case '[object Number]': + // `NaN`s are equivalent, but non-reflexive. + // Object(NaN) is equivalent to NaN. + if (+a !== +a) return +b !== +b; + // An `egal` comparison is performed for other numeric values. + return +a === 0 ? 1 / +a === 1 / b : +a === +b; + case '[object Date]': + case '[object Boolean]': + // Coerce dates and booleans to numeric primitive values. Dates are compared by their + // millisecond representations. Note that invalid dates with millisecond representations + // of `NaN` are not equivalent. + return +a === +b; + case '[object Symbol]': + return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b); + case '[object ArrayBuffer]': + case tagDataView: + // Coerce to typed array so we can fall through. + return deepEq(toBufferView(a), toBufferView(b), aStack, bStack); + } + + var areArrays = className === '[object Array]'; + if (!areArrays && isTypedArray$1(a)) { + var byteLength = getByteLength(a); + if (byteLength !== getByteLength(b)) return false; + if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true; + areArrays = true; + } + if (!areArrays) { + if (typeof a != 'object' || typeof b != 'object') return false; + + // Objects with different constructors are not equivalent, but `Object`s or `Array`s + // from different frames are. + var aCtor = a.constructor, bCtor = b.constructor; + if (aCtor !== bCtor && !(isFunction$1(aCtor) && aCtor instanceof aCtor && + isFunction$1(bCtor) && bCtor instanceof bCtor) + && ('constructor' in a && 'constructor' in b)) { + return false; + } + } + // Assume equality for cyclic structures. The algorithm for detecting cyclic + // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. + + // Initializing stack of traversed objects. + // It's done here since we only need them for objects and arrays comparison. + aStack = aStack || []; + bStack = bStack || []; + var length = aStack.length; + while (length--) { + // Linear search. Performance is inversely proportional to the number of + // unique nested structures. + if (aStack[length] === a) return bStack[length] === b; + } + + // Add the first object to the stack of traversed objects. + aStack.push(a); + bStack.push(b); + + // Recursively compare objects and arrays. + if (areArrays) { + // Compare array lengths to determine if a deep comparison is necessary. + length = a.length; + if (length !== b.length) return false; + // Deep compare the contents, ignoring non-numeric properties. + while (length--) { + if (!eq(a[length], b[length], aStack, bStack)) return false; + } + } else { + // Deep compare objects. + var _keys = keys(a), key; + length = _keys.length; + // Ensure that both objects contain the same number of properties before comparing deep equality. + if (keys(b).length !== length) return false; + while (length--) { + // Deep compare each member + key = _keys[length]; + if (!(has$1(b, key) && eq(a[key], b[key], aStack, bStack))) return false; + } + } + // Remove the first object from the stack of traversed objects. + aStack.pop(); + bStack.pop(); + return true; + } + + // Perform a deep comparison to check if two objects are equal. + function isEqual(a, b) { + return eq(a, b); + } + + // Retrieve all the enumerable property names of an object. + function allKeys(obj) { + if (!isObject(obj)) return []; + var keys = []; + for (var key in obj) keys.push(key); + // Ahem, IE < 9. + if (hasEnumBug) collectNonEnumProps(obj, keys); + return keys; + } + + // Since the regular `Object.prototype.toString` type tests don't work for + // some types in IE 11, we use a fingerprinting heuristic instead, based + // on the methods. It's not great, but it's the best we got. + // The fingerprint method lists are defined below. + function ie11fingerprint(methods) { + var length = getLength(methods); + return function(obj) { + if (obj == null) return false; + // `Map`, `WeakMap` and `Set` have no enumerable keys. + var keys = allKeys(obj); + if (getLength(keys)) return false; + for (var i = 0; i < length; i++) { + if (!isFunction$1(obj[methods[i]])) return false; + } + // If we are testing against `WeakMap`, we need to ensure that + // `obj` doesn't have a `forEach` method in order to distinguish + // it from a regular `Map`. + return methods !== weakMapMethods || !isFunction$1(obj[forEachName]); + }; + } + + // In the interest of compact minification, we write + // each string in the fingerprints only once. + var forEachName = 'forEach', + hasName = 'has', + commonInit = ['clear', 'delete'], + mapTail = ['get', hasName, 'set']; + + // `Map`, `WeakMap` and `Set` each have slightly different + // combinations of the above sublists. + var mapMethods = commonInit.concat(forEachName, mapTail), + weakMapMethods = commonInit.concat(mapTail), + setMethods = ['add'].concat(commonInit, forEachName, hasName); + + var isMap = isIE11 ? ie11fingerprint(mapMethods) : tagTester('Map'); + + var isWeakMap = isIE11 ? ie11fingerprint(weakMapMethods) : tagTester('WeakMap'); + + var isSet = isIE11 ? ie11fingerprint(setMethods) : tagTester('Set'); + + var isWeakSet = tagTester('WeakSet'); + + // Retrieve the values of an object's properties. + function values(obj) { + var _keys = keys(obj); + var length = _keys.length; + var values = Array(length); + for (var i = 0; i < length; i++) { + values[i] = obj[_keys[i]]; + } + return values; + } + + // Convert an object into a list of `[key, value]` pairs. + // The opposite of `_.object` with one argument. + function pairs(obj) { + var _keys = keys(obj); + var length = _keys.length; + var pairs = Array(length); + for (var i = 0; i < length; i++) { + pairs[i] = [_keys[i], obj[_keys[i]]]; + } + return pairs; + } + + // Invert the keys and values of an object. The values must be serializable. + function invert(obj) { + var result = {}; + var _keys = keys(obj); + for (var i = 0, length = _keys.length; i < length; i++) { + result[obj[_keys[i]]] = _keys[i]; + } + return result; + } + + // Return a sorted list of the function names available on the object. + function functions(obj) { + var names = []; + for (var key in obj) { + if (isFunction$1(obj[key])) names.push(key); + } + return names.sort(); + } + + // An internal function for creating assigner functions. + function createAssigner(keysFunc, defaults) { + return function(obj) { + var length = arguments.length; + if (defaults) obj = Object(obj); + if (length < 2 || obj == null) return obj; + for (var index = 1; index < length; index++) { + var source = arguments[index], + keys = keysFunc(source), + l = keys.length; + for (var i = 0; i < l; i++) { + var key = keys[i]; + if (!defaults || obj[key] === void 0) obj[key] = source[key]; + } + } + return obj; + }; + } + + // Extend a given object with all the properties in passed-in object(s). + var extend = createAssigner(allKeys); + + // Assigns a given object with all the own properties in the passed-in + // object(s). + // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) + var extendOwn = createAssigner(keys); + + // Fill in a given object with default properties. + var defaults = createAssigner(allKeys, true); + + // Create a naked function reference for surrogate-prototype-swapping. + function ctor() { + return function(){}; + } + + // An internal function for creating a new object that inherits from another. + function baseCreate(prototype) { + if (!isObject(prototype)) return {}; + if (nativeCreate) return nativeCreate(prototype); + var Ctor = ctor(); + Ctor.prototype = prototype; + var result = new Ctor; + Ctor.prototype = null; + return result; + } + + // Creates an object that inherits from the given prototype object. + // If additional properties are provided then they will be added to the + // created object. + function create(prototype, props) { + var result = baseCreate(prototype); + if (props) extendOwn(result, props); + return result; + } + + // Create a (shallow-cloned) duplicate of an object. + function clone(obj) { + if (!isObject(obj)) return obj; + return isArray(obj) ? obj.slice() : extend({}, obj); + } + + // Invokes `interceptor` with the `obj` and then returns `obj`. + // The primary purpose of this method is to "tap into" a method chain, in + // order to perform operations on intermediate results within the chain. + function tap(obj, interceptor) { + interceptor(obj); + return obj; + } + + // Normalize a (deep) property `path` to array. + // Like `_.iteratee`, this function can be customized. + function toPath$1(path) { + return isArray(path) ? path : [path]; + } + _$1.toPath = toPath$1; + + // Internal wrapper for `_.toPath` to enable minification. + // Similar to `cb` for `_.iteratee`. + function toPath(path) { + return _$1.toPath(path); + } + + // Internal function to obtain a nested property in `obj` along `path`. + function deepGet(obj, path) { + var length = path.length; + for (var i = 0; i < length; i++) { + if (obj == null) return void 0; + obj = obj[path[i]]; + } + return length ? obj : void 0; + } + + // Get the value of the (deep) property on `path` from `object`. + // If any property in `path` does not exist or if the value is + // `undefined`, return `defaultValue` instead. + // The `path` is normalized through `_.toPath`. + function get(object, path, defaultValue) { + var value = deepGet(object, toPath(path)); + return isUndefined(value) ? defaultValue : value; + } + + // Shortcut function for checking if an object has a given property directly on + // itself (in other words, not on a prototype). Unlike the internal `has` + // function, this public version can also traverse nested properties. + function has(obj, path) { + path = toPath(path); + var length = path.length; + for (var i = 0; i < length; i++) { + var key = path[i]; + if (!has$1(obj, key)) return false; + obj = obj[key]; + } + return !!length; + } + + // Keep the identity function around for default iteratees. + function identity(value) { + return value; + } + + // Returns a predicate for checking whether an object has a given set of + // `key:value` pairs. + function matcher(attrs) { + attrs = extendOwn({}, attrs); + return function(obj) { + return isMatch(obj, attrs); + }; + } + + // Creates a function that, when passed an object, will traverse that object’s + // properties down the given `path`, specified as an array of keys or indices. + function property(path) { + path = toPath(path); + return function(obj) { + return deepGet(obj, path); + }; + } + + // Internal function that returns an efficient (for current engines) version + // of the passed-in callback, to be repeatedly applied in other Underscore + // functions. + function optimizeCb(func, context, argCount) { + if (context === void 0) return func; + switch (argCount == null ? 3 : argCount) { + case 1: return function(value) { + return func.call(context, value); + }; + // The 2-argument case is omitted because we’re not using it. + case 3: return function(value, index, collection) { + return func.call(context, value, index, collection); + }; + case 4: return function(accumulator, value, index, collection) { + return func.call(context, accumulator, value, index, collection); + }; + } + return function() { + return func.apply(context, arguments); + }; + } + + // An internal function to generate callbacks that can be applied to each + // element in a collection, returning the desired result — either `_.identity`, + // an arbitrary callback, a property matcher, or a property accessor. + function baseIteratee(value, context, argCount) { + if (value == null) return identity; + if (isFunction$1(value)) return optimizeCb(value, context, argCount); + if (isObject(value) && !isArray(value)) return matcher(value); + return property(value); + } + + // External wrapper for our callback generator. Users may customize + // `_.iteratee` if they want additional predicate/iteratee shorthand styles. + // This abstraction hides the internal-only `argCount` argument. + function iteratee(value, context) { + return baseIteratee(value, context, Infinity); + } + _$1.iteratee = iteratee; + + // The function we call internally to generate a callback. It invokes + // `_.iteratee` if overridden, otherwise `baseIteratee`. + function cb(value, context, argCount) { + if (_$1.iteratee !== iteratee) return _$1.iteratee(value, context); + return baseIteratee(value, context, argCount); + } + + // Returns the results of applying the `iteratee` to each element of `obj`. + // In contrast to `_.map` it returns an object. + function mapObject(obj, iteratee, context) { + iteratee = cb(iteratee, context); + var _keys = keys(obj), + length = _keys.length, + results = {}; + for (var index = 0; index < length; index++) { + var currentKey = _keys[index]; + results[currentKey] = iteratee(obj[currentKey], currentKey, obj); + } + return results; + } + + // Predicate-generating function. Often useful outside of Underscore. + function noop(){} + + // Generates a function for a given object that returns a given property. + function propertyOf(obj) { + if (obj == null) return noop; + return function(path) { + return get(obj, path); + }; + } + + // Run a function **n** times. + function times(n, iteratee, context) { + var accum = Array(Math.max(0, n)); + iteratee = optimizeCb(iteratee, context, 1); + for (var i = 0; i < n; i++) accum[i] = iteratee(i); + return accum; + } + + // Return a random integer between `min` and `max` (inclusive). + function random(min, max) { + if (max == null) { + max = min; + min = 0; + } + return min + Math.floor(Math.random() * (max - min + 1)); + } + + // A (possibly faster) way to get the current timestamp as an integer. + var now = Date.now || function() { + return new Date().getTime(); + }; + + // Internal helper to generate functions for escaping and unescaping strings + // to/from HTML interpolation. + function createEscaper(map) { + var escaper = function(match) { + return map[match]; + }; + // Regexes for identifying a key that needs to be escaped. + var source = '(?:' + keys(map).join('|') + ')'; + var testRegexp = RegExp(source); + var replaceRegexp = RegExp(source, 'g'); + return function(string) { + string = string == null ? '' : '' + string; + return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; + }; + } + + // Internal list of HTML entities for escaping. + var escapeMap = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''', + '`': '`' + }; + + // Function for escaping strings to HTML interpolation. + var _escape = createEscaper(escapeMap); + + // Internal list of HTML entities for unescaping. + var unescapeMap = invert(escapeMap); + + // Function for unescaping strings from HTML interpolation. + var _unescape = createEscaper(unescapeMap); + + // By default, Underscore uses ERB-style template delimiters. Change the + // following template settings to use alternative delimiters. + var templateSettings = _$1.templateSettings = { + evaluate: /<%([\s\S]+?)%>/g, + interpolate: /<%=([\s\S]+?)%>/g, + escape: /<%-([\s\S]+?)%>/g + }; + + // When customizing `_.templateSettings`, if you don't want to define an + // interpolation, evaluation or escaping regex, we need one that is + // guaranteed not to match. + var noMatch = /(.)^/; + + // Certain characters need to be escaped so that they can be put into a + // string literal. + var escapes = { + "'": "'", + '\\': '\\', + '\r': 'r', + '\n': 'n', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g; + + function escapeChar(match) { + return '\\' + escapes[match]; + } + + // In order to prevent third-party code injection through + // `_.templateSettings.variable`, we test it against the following regular + // expression. It is intentionally a bit more liberal than just matching valid + // identifiers, but still prevents possible loopholes through defaults or + // destructuring assignment. + var bareIdentifier = /^\s*(\w|\$)+\s*$/; + + // JavaScript micro-templating, similar to John Resig's implementation. + // Underscore templating handles arbitrary delimiters, preserves whitespace, + // and correctly escapes quotes within interpolated code. + // NB: `oldSettings` only exists for backwards compatibility. + function template(text, settings, oldSettings) { + if (!settings && oldSettings) settings = oldSettings; + settings = defaults({}, settings, _$1.templateSettings); + + // Combine delimiters into one regular expression via alternation. + var matcher = RegExp([ + (settings.escape || noMatch).source, + (settings.interpolate || noMatch).source, + (settings.evaluate || noMatch).source + ].join('|') + '|$', 'g'); + + // Compile the template source, escaping string literals appropriately. + var index = 0; + var source = "__p+='"; + text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { + source += text.slice(index, offset).replace(escapeRegExp, escapeChar); + index = offset + match.length; + + if (escape) { + source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; + } else if (interpolate) { + source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; + } else if (evaluate) { + source += "';\n" + evaluate + "\n__p+='"; + } + + // Adobe VMs need the match returned to produce the correct offset. + return match; + }); + source += "';\n"; + + var argument = settings.variable; + if (argument) { + // Insure against third-party code injection. (CVE-2021-23358) + if (!bareIdentifier.test(argument)) throw new Error( + 'variable is not a bare identifier: ' + argument + ); + } else { + // If a variable is not specified, place data values in local scope. + source = 'with(obj||{}){\n' + source + '}\n'; + argument = 'obj'; + } + + source = "var __t,__p='',__j=Array.prototype.join," + + "print=function(){__p+=__j.call(arguments,'');};\n" + + source + 'return __p;\n'; + + var render; + try { + render = new Function(argument, '_', source); + } catch (e) { + e.source = source; + throw e; + } + + var template = function(data) { + return render.call(this, data, _$1); + }; + + // Provide the compiled source as a convenience for precompilation. + template.source = 'function(' + argument + '){\n' + source + '}'; + + return template; + } + + // Traverses the children of `obj` along `path`. If a child is a function, it + // is invoked with its parent as context. Returns the value of the final + // child, or `fallback` if any child is undefined. + function result(obj, path, fallback) { + path = toPath(path); + var length = path.length; + if (!length) { + return isFunction$1(fallback) ? fallback.call(obj) : fallback; + } + for (var i = 0; i < length; i++) { + var prop = obj == null ? void 0 : obj[path[i]]; + if (prop === void 0) { + prop = fallback; + i = length; // Ensure we don't continue iterating. + } + obj = isFunction$1(prop) ? prop.call(obj) : prop; + } + return obj; + } + + // Generate a unique integer id (unique within the entire client session). + // Useful for temporary DOM ids. + var idCounter = 0; + function uniqueId(prefix) { + var id = ++idCounter + ''; + return prefix ? prefix + id : id; + } + + // Start chaining a wrapped Underscore object. + function chain(obj) { + var instance = _$1(obj); + instance._chain = true; + return instance; + } + + // Internal function to execute `sourceFunc` bound to `context` with optional + // `args`. Determines whether to execute a function as a constructor or as a + // normal function. + function executeBound(sourceFunc, boundFunc, context, callingContext, args) { + if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); + var self = baseCreate(sourceFunc.prototype); + var result = sourceFunc.apply(self, args); + if (isObject(result)) return result; + return self; + } + + // Partially apply a function by creating a version that has had some of its + // arguments pre-filled, without changing its dynamic `this` context. `_` acts + // as a placeholder by default, allowing any combination of arguments to be + // pre-filled. Set `_.partial.placeholder` for a custom placeholder argument. + var partial = restArguments(function(func, boundArgs) { + var placeholder = partial.placeholder; + var bound = function() { + var position = 0, length = boundArgs.length; + var args = Array(length); + for (var i = 0; i < length; i++) { + args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i]; + } + while (position < arguments.length) args.push(arguments[position++]); + return executeBound(func, bound, this, this, args); + }; + return bound; + }); + + partial.placeholder = _$1; + + // Create a function bound to a given object (assigning `this`, and arguments, + // optionally). + var bind = restArguments(function(func, context, args) { + if (!isFunction$1(func)) throw new TypeError('Bind must be called on a function'); + var bound = restArguments(function(callArgs) { + return executeBound(func, bound, context, this, args.concat(callArgs)); + }); + return bound; + }); + + // Internal helper for collection methods to determine whether a collection + // should be iterated as an array or as an object. + // Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength + // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094 + var isArrayLike = createSizePropertyCheck(getLength); + + // Internal implementation of a recursive `flatten` function. + function flatten$1(input, depth, strict, output) { + output = output || []; + if (!depth && depth !== 0) { + depth = Infinity; + } else if (depth <= 0) { + return output.concat(input); + } + var idx = output.length; + for (var i = 0, length = getLength(input); i < length; i++) { + var value = input[i]; + if (isArrayLike(value) && (isArray(value) || isArguments$1(value))) { + // Flatten current level of array or arguments object. + if (depth > 1) { + flatten$1(value, depth - 1, strict, output); + idx = output.length; + } else { + var j = 0, len = value.length; + while (j < len) output[idx++] = value[j++]; + } + } else if (!strict) { + output[idx++] = value; + } + } + return output; + } + + // Bind a number of an object's methods to that object. Remaining arguments + // are the method names to be bound. Useful for ensuring that all callbacks + // defined on an object belong to it. + var bindAll = restArguments(function(obj, keys) { + keys = flatten$1(keys, false, false); + var index = keys.length; + if (index < 1) throw new Error('bindAll must be passed function names'); + while (index--) { + var key = keys[index]; + obj[key] = bind(obj[key], obj); + } + return obj; + }); + + // Memoize an expensive function by storing its results. + function memoize(func, hasher) { + var memoize = function(key) { + var cache = memoize.cache; + var address = '' + (hasher ? hasher.apply(this, arguments) : key); + if (!has$1(cache, address)) cache[address] = func.apply(this, arguments); + return cache[address]; + }; + memoize.cache = {}; + return memoize; + } + + // Delays a function for the given number of milliseconds, and then calls + // it with the arguments supplied. + var delay = restArguments(function(func, wait, args) { + return setTimeout(function() { + return func.apply(null, args); + }, wait); + }); + + // Defers a function, scheduling it to run after the current call stack has + // cleared. + var defer = partial(delay, _$1, 1); + + // Returns a function, that, when invoked, will only be triggered at most once + // during a given window of time. Normally, the throttled function will run + // as much as it can, without ever going more than once per `wait` duration; + // but if you'd like to disable the execution on the leading edge, pass + // `{leading: false}`. To disable execution on the trailing edge, ditto. + function throttle(func, wait, options) { + var timeout, context, args, result; + var previous = 0; + if (!options) options = {}; + + var later = function() { + previous = options.leading === false ? 0 : now(); + timeout = null; + result = func.apply(context, args); + if (!timeout) context = args = null; + }; + + var throttled = function() { + var _now = now(); + if (!previous && options.leading === false) previous = _now; + var remaining = wait - (_now - previous); + context = this; + args = arguments; + if (remaining <= 0 || remaining > wait) { + if (timeout) { + clearTimeout(timeout); + timeout = null; + } + previous = _now; + result = func.apply(context, args); + if (!timeout) context = args = null; + } else if (!timeout && options.trailing !== false) { + timeout = setTimeout(later, remaining); + } + return result; + }; + + throttled.cancel = function() { + clearTimeout(timeout); + previous = 0; + timeout = context = args = null; + }; + + return throttled; + } + + // When a sequence of calls of the returned function ends, the argument + // function is triggered. The end of a sequence is defined by the `wait` + // parameter. If `immediate` is passed, the argument function will be + // triggered at the beginning of the sequence instead of at the end. + function debounce(func, wait, immediate) { + var timeout, previous, args, result, context; + + var later = function() { + var passed = now() - previous; + if (wait > passed) { + timeout = setTimeout(later, wait - passed); + } else { + timeout = null; + if (!immediate) result = func.apply(context, args); + // This check is needed because `func` can recursively invoke `debounced`. + if (!timeout) args = context = null; + } + }; + + var debounced = restArguments(function(_args) { + context = this; + args = _args; + previous = now(); + if (!timeout) { + timeout = setTimeout(later, wait); + if (immediate) result = func.apply(context, args); + } + return result; + }); + + debounced.cancel = function() { + clearTimeout(timeout); + timeout = args = context = null; + }; + + return debounced; + } + + // Returns the first function passed as an argument to the second, + // allowing you to adjust arguments, run code before and after, and + // conditionally execute the original function. + function wrap(func, wrapper) { + return partial(wrapper, func); + } + + // Returns a negated version of the passed-in predicate. + function negate(predicate) { + return function() { + return !predicate.apply(this, arguments); + }; + } + + // Returns a function that is the composition of a list of functions, each + // consuming the return value of the function that follows. + function compose() { + var args = arguments; + var start = args.length - 1; + return function() { + var i = start; + var result = args[start].apply(this, arguments); + while (i--) result = args[i].call(this, result); + return result; + }; + } + + // Returns a function that will only be executed on and after the Nth call. + function after(times, func) { + return function() { + if (--times < 1) { + return func.apply(this, arguments); + } + }; + } + + // Returns a function that will only be executed up to (but not including) the + // Nth call. + function before(times, func) { + var memo; + return function() { + if (--times > 0) { + memo = func.apply(this, arguments); + } + if (times <= 1) func = null; + return memo; + }; + } + + // Returns a function that will be executed at most one time, no matter how + // often you call it. Useful for lazy initialization. + var once = partial(before, 2); + + // Returns the first key on an object that passes a truth test. + function findKey(obj, predicate, context) { + predicate = cb(predicate, context); + var _keys = keys(obj), key; + for (var i = 0, length = _keys.length; i < length; i++) { + key = _keys[i]; + if (predicate(obj[key], key, obj)) return key; + } + } + + // Internal function to generate `_.findIndex` and `_.findLastIndex`. + function createPredicateIndexFinder(dir) { + return function(array, predicate, context) { + predicate = cb(predicate, context); + var length = getLength(array); + var index = dir > 0 ? 0 : length - 1; + for (; index >= 0 && index < length; index += dir) { + if (predicate(array[index], index, array)) return index; + } + return -1; + }; + } + + // Returns the first index on an array-like that passes a truth test. + var findIndex = createPredicateIndexFinder(1); + + // Returns the last index on an array-like that passes a truth test. + var findLastIndex = createPredicateIndexFinder(-1); + + // Use a comparator function to figure out the smallest index at which + // an object should be inserted so as to maintain order. Uses binary search. + function sortedIndex(array, obj, iteratee, context) { + iteratee = cb(iteratee, context, 1); + var value = iteratee(obj); + var low = 0, high = getLength(array); + while (low < high) { + var mid = Math.floor((low + high) / 2); + if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; + } + return low; + } + + // Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions. + function createIndexFinder(dir, predicateFind, sortedIndex) { + return function(array, item, idx) { + var i = 0, length = getLength(array); + if (typeof idx == 'number') { + if (dir > 0) { + i = idx >= 0 ? idx : Math.max(idx + length, i); + } else { + length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1; + } + } else if (sortedIndex && idx && length) { + idx = sortedIndex(array, item); + return array[idx] === item ? idx : -1; + } + if (item !== item) { + idx = predicateFind(slice.call(array, i, length), isNaN$1); + return idx >= 0 ? idx + i : -1; + } + for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) { + if (array[idx] === item) return idx; + } + return -1; + }; + } + + // Return the position of the first occurrence of an item in an array, + // or -1 if the item is not included in the array. + // If the array is large and already in sort order, pass `true` + // for **isSorted** to use binary search. + var indexOf = createIndexFinder(1, findIndex, sortedIndex); + + // Return the position of the last occurrence of an item in an array, + // or -1 if the item is not included in the array. + var lastIndexOf = createIndexFinder(-1, findLastIndex); + + // Return the first value which passes a truth test. + function find(obj, predicate, context) { + var keyFinder = isArrayLike(obj) ? findIndex : findKey; + var key = keyFinder(obj, predicate, context); + if (key !== void 0 && key !== -1) return obj[key]; + } + + // Convenience version of a common use case of `_.find`: getting the first + // object containing specific `key:value` pairs. + function findWhere(obj, attrs) { + return find(obj, matcher(attrs)); + } + + // The cornerstone for collection functions, an `each` + // implementation, aka `forEach`. + // Handles raw objects in addition to array-likes. Treats all + // sparse array-likes as if they were dense. + function each(obj, iteratee, context) { + iteratee = optimizeCb(iteratee, context); + var i, length; + if (isArrayLike(obj)) { + for (i = 0, length = obj.length; i < length; i++) { + iteratee(obj[i], i, obj); + } + } else { + var _keys = keys(obj); + for (i = 0, length = _keys.length; i < length; i++) { + iteratee(obj[_keys[i]], _keys[i], obj); + } + } + return obj; + } + + // Return the results of applying the iteratee to each element. + function map(obj, iteratee, context) { + iteratee = cb(iteratee, context); + var _keys = !isArrayLike(obj) && keys(obj), + length = (_keys || obj).length, + results = Array(length); + for (var index = 0; index < length; index++) { + var currentKey = _keys ? _keys[index] : index; + results[index] = iteratee(obj[currentKey], currentKey, obj); + } + return results; + } + + // Internal helper to create a reducing function, iterating left or right. + function createReduce(dir) { + // Wrap code that reassigns argument variables in a separate function than + // the one that accesses `arguments.length` to avoid a perf hit. (#1991) + var reducer = function(obj, iteratee, memo, initial) { + var _keys = !isArrayLike(obj) && keys(obj), + length = (_keys || obj).length, + index = dir > 0 ? 0 : length - 1; + if (!initial) { + memo = obj[_keys ? _keys[index] : index]; + index += dir; + } + for (; index >= 0 && index < length; index += dir) { + var currentKey = _keys ? _keys[index] : index; + memo = iteratee(memo, obj[currentKey], currentKey, obj); + } + return memo; + }; + + return function(obj, iteratee, memo, context) { + var initial = arguments.length >= 3; + return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial); + }; + } + + // **Reduce** builds up a single result from a list of values, aka `inject`, + // or `foldl`. + var reduce = createReduce(1); + + // The right-associative version of reduce, also known as `foldr`. + var reduceRight = createReduce(-1); + + // Return all the elements that pass a truth test. + function filter(obj, predicate, context) { + var results = []; + predicate = cb(predicate, context); + each(obj, function(value, index, list) { + if (predicate(value, index, list)) results.push(value); + }); + return results; + } + + // Return all the elements for which a truth test fails. + function reject(obj, predicate, context) { + return filter(obj, negate(cb(predicate)), context); + } + + // Determine whether all of the elements pass a truth test. + function every(obj, predicate, context) { + predicate = cb(predicate, context); + var _keys = !isArrayLike(obj) && keys(obj), + length = (_keys || obj).length; + for (var index = 0; index < length; index++) { + var currentKey = _keys ? _keys[index] : index; + if (!predicate(obj[currentKey], currentKey, obj)) return false; + } + return true; + } + + // Determine if at least one element in the object passes a truth test. + function some(obj, predicate, context) { + predicate = cb(predicate, context); + var _keys = !isArrayLike(obj) && keys(obj), + length = (_keys || obj).length; + for (var index = 0; index < length; index++) { + var currentKey = _keys ? _keys[index] : index; + if (predicate(obj[currentKey], currentKey, obj)) return true; + } + return false; + } + + // Determine if the array or object contains a given item (using `===`). + function contains(obj, item, fromIndex, guard) { + if (!isArrayLike(obj)) obj = values(obj); + if (typeof fromIndex != 'number' || guard) fromIndex = 0; + return indexOf(obj, item, fromIndex) >= 0; + } + + // Invoke a method (with arguments) on every item in a collection. + var invoke = restArguments(function(obj, path, args) { + var contextPath, func; + if (isFunction$1(path)) { + func = path; + } else { + path = toPath(path); + contextPath = path.slice(0, -1); + path = path[path.length - 1]; + } + return map(obj, function(context) { + var method = func; + if (!method) { + if (contextPath && contextPath.length) { + context = deepGet(context, contextPath); + } + if (context == null) return void 0; + method = context[path]; + } + return method == null ? method : method.apply(context, args); + }); + }); + + // Convenience version of a common use case of `_.map`: fetching a property. + function pluck(obj, key) { + return map(obj, property(key)); + } + + // Convenience version of a common use case of `_.filter`: selecting only + // objects containing specific `key:value` pairs. + function where(obj, attrs) { + return filter(obj, matcher(attrs)); + } + + // Return the maximum element (or element-based computation). + function max(obj, iteratee, context) { + var result = -Infinity, lastComputed = -Infinity, + value, computed; + if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) { + obj = isArrayLike(obj) ? obj : values(obj); + for (var i = 0, length = obj.length; i < length; i++) { + value = obj[i]; + if (value != null && value > result) { + result = value; + } + } + } else { + iteratee = cb(iteratee, context); + each(obj, function(v, index, list) { + computed = iteratee(v, index, list); + if (computed > lastComputed || computed === -Infinity && result === -Infinity) { + result = v; + lastComputed = computed; + } + }); + } + return result; + } + + // Return the minimum element (or element-based computation). + function min(obj, iteratee, context) { + var result = Infinity, lastComputed = Infinity, + value, computed; + if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) { + obj = isArrayLike(obj) ? obj : values(obj); + for (var i = 0, length = obj.length; i < length; i++) { + value = obj[i]; + if (value != null && value < result) { + result = value; + } + } + } else { + iteratee = cb(iteratee, context); + each(obj, function(v, index, list) { + computed = iteratee(v, index, list); + if (computed < lastComputed || computed === Infinity && result === Infinity) { + result = v; + lastComputed = computed; + } + }); + } + return result; + } + + // Sample **n** random values from a collection using the modern version of the + // [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle). + // If **n** is not specified, returns a single random element. + // The internal `guard` argument allows it to work with `_.map`. + function sample(obj, n, guard) { + if (n == null || guard) { + if (!isArrayLike(obj)) obj = values(obj); + return obj[random(obj.length - 1)]; + } + var sample = isArrayLike(obj) ? clone(obj) : values(obj); + var length = getLength(sample); + n = Math.max(Math.min(n, length), 0); + var last = length - 1; + for (var index = 0; index < n; index++) { + var rand = random(index, last); + var temp = sample[index]; + sample[index] = sample[rand]; + sample[rand] = temp; + } + return sample.slice(0, n); + } + + // Shuffle a collection. + function shuffle(obj) { + return sample(obj, Infinity); + } + + // Sort the object's values by a criterion produced by an iteratee. + function sortBy(obj, iteratee, context) { + var index = 0; + iteratee = cb(iteratee, context); + return pluck(map(obj, function(value, key, list) { + return { + value: value, + index: index++, + criteria: iteratee(value, key, list) + }; + }).sort(function(left, right) { + var a = left.criteria; + var b = right.criteria; + if (a !== b) { + if (a > b || a === void 0) return 1; + if (a < b || b === void 0) return -1; + } + return left.index - right.index; + }), 'value'); + } + + // An internal function used for aggregate "group by" operations. + function group(behavior, partition) { + return function(obj, iteratee, context) { + var result = partition ? [[], []] : {}; + iteratee = cb(iteratee, context); + each(obj, function(value, index) { + var key = iteratee(value, index, obj); + behavior(result, value, key); + }); + return result; + }; + } + + // Groups the object's values by a criterion. Pass either a string attribute + // to group by, or a function that returns the criterion. + var groupBy = group(function(result, value, key) { + if (has$1(result, key)) result[key].push(value); else result[key] = [value]; + }); + + // Indexes the object's values by a criterion, similar to `_.groupBy`, but for + // when you know that your index values will be unique. + var indexBy = group(function(result, value, key) { + result[key] = value; + }); + + // Counts instances of an object that group by a certain criterion. Pass + // either a string attribute to count by, or a function that returns the + // criterion. + var countBy = group(function(result, value, key) { + if (has$1(result, key)) result[key]++; else result[key] = 1; + }); + + // Split a collection into two arrays: one whose elements all pass the given + // truth test, and one whose elements all do not pass the truth test. + var partition = group(function(result, value, pass) { + result[pass ? 0 : 1].push(value); + }, true); + + // Safely create a real, live array from anything iterable. + var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g; + function toArray(obj) { + if (!obj) return []; + if (isArray(obj)) return slice.call(obj); + if (isString(obj)) { + // Keep surrogate pair characters together. + return obj.match(reStrSymbol); + } + if (isArrayLike(obj)) return map(obj, identity); + return values(obj); + } + + // Return the number of elements in a collection. + function size(obj) { + if (obj == null) return 0; + return isArrayLike(obj) ? obj.length : keys(obj).length; + } + + // Internal `_.pick` helper function to determine whether `key` is an enumerable + // property name of `obj`. + function keyInObj(value, key, obj) { + return key in obj; + } + + // Return a copy of the object only containing the allowed properties. + var pick = restArguments(function(obj, keys) { + var result = {}, iteratee = keys[0]; + if (obj == null) return result; + if (isFunction$1(iteratee)) { + if (keys.length > 1) iteratee = optimizeCb(iteratee, keys[1]); + keys = allKeys(obj); + } else { + iteratee = keyInObj; + keys = flatten$1(keys, false, false); + obj = Object(obj); + } + for (var i = 0, length = keys.length; i < length; i++) { + var key = keys[i]; + var value = obj[key]; + if (iteratee(value, key, obj)) result[key] = value; + } + return result; + }); + + // Return a copy of the object without the disallowed properties. + var omit = restArguments(function(obj, keys) { + var iteratee = keys[0], context; + if (isFunction$1(iteratee)) { + iteratee = negate(iteratee); + if (keys.length > 1) context = keys[1]; + } else { + keys = map(flatten$1(keys, false, false), String); + iteratee = function(value, key) { + return !contains(keys, key); + }; + } + return pick(obj, iteratee, context); + }); + + // Returns everything but the last entry of the array. Especially useful on + // the arguments object. Passing **n** will return all the values in + // the array, excluding the last N. + function initial(array, n, guard) { + return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); + } + + // Get the first element of an array. Passing **n** will return the first N + // values in the array. The **guard** check allows it to work with `_.map`. + function first(array, n, guard) { + if (array == null || array.length < 1) return n == null || guard ? void 0 : []; + if (n == null || guard) return array[0]; + return initial(array, array.length - n); + } + + // Returns everything but the first entry of the `array`. Especially useful on + // the `arguments` object. Passing an **n** will return the rest N values in the + // `array`. + function rest(array, n, guard) { + return slice.call(array, n == null || guard ? 1 : n); + } + + // Get the last element of an array. Passing **n** will return the last N + // values in the array. + function last(array, n, guard) { + if (array == null || array.length < 1) return n == null || guard ? void 0 : []; + if (n == null || guard) return array[array.length - 1]; + return rest(array, Math.max(0, array.length - n)); + } + + // Trim out all falsy values from an array. + function compact(array) { + return filter(array, Boolean); + } + + // Flatten out an array, either recursively (by default), or up to `depth`. + // Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively. + function flatten(array, depth) { + return flatten$1(array, depth, false); + } + + // Take the difference between one array and a number of other arrays. + // Only the elements present in just the first array will remain. + var difference = restArguments(function(array, rest) { + rest = flatten$1(rest, true, true); + return filter(array, function(value){ + return !contains(rest, value); + }); + }); + + // Return a version of the array that does not contain the specified value(s). + var without = restArguments(function(array, otherArrays) { + return difference(array, otherArrays); + }); + + // Produce a duplicate-free version of the array. If the array has already + // been sorted, you have the option of using a faster algorithm. + // The faster algorithm will not work with an iteratee if the iteratee + // is not a one-to-one function, so providing an iteratee will disable + // the faster algorithm. + function uniq(array, isSorted, iteratee, context) { + if (!isBoolean(isSorted)) { + context = iteratee; + iteratee = isSorted; + isSorted = false; + } + if (iteratee != null) iteratee = cb(iteratee, context); + var result = []; + var seen = []; + for (var i = 0, length = getLength(array); i < length; i++) { + var value = array[i], + computed = iteratee ? iteratee(value, i, array) : value; + if (isSorted && !iteratee) { + if (!i || seen !== computed) result.push(value); + seen = computed; + } else if (iteratee) { + if (!contains(seen, computed)) { + seen.push(computed); + result.push(value); + } + } else if (!contains(result, value)) { + result.push(value); + } + } + return result; + } + + // Produce an array that contains the union: each distinct element from all of + // the passed-in arrays. + var union = restArguments(function(arrays) { + return uniq(flatten$1(arrays, true, true)); + }); + + // Produce an array that contains every item shared between all the + // passed-in arrays. + function intersection(array) { + var result = []; + var argsLength = arguments.length; + for (var i = 0, length = getLength(array); i < length; i++) { + var item = array[i]; + if (contains(result, item)) continue; + var j; + for (j = 1; j < argsLength; j++) { + if (!contains(arguments[j], item)) break; + } + if (j === argsLength) result.push(item); + } + return result; + } + + // Complement of zip. Unzip accepts an array of arrays and groups + // each array's elements on shared indices. + function unzip(array) { + var length = array && max(array, getLength).length || 0; + var result = Array(length); + + for (var index = 0; index < length; index++) { + result[index] = pluck(array, index); + } + return result; + } + + // Zip together multiple lists into a single array -- elements that share + // an index go together. + var zip = restArguments(unzip); + + // Converts lists into objects. Pass either a single array of `[key, value]` + // pairs, or two parallel arrays of the same length -- one of keys, and one of + // the corresponding values. Passing by pairs is the reverse of `_.pairs`. + function object(list, values) { + var result = {}; + for (var i = 0, length = getLength(list); i < length; i++) { + if (values) { + result[list[i]] = values[i]; + } else { + result[list[i][0]] = list[i][1]; + } + } + return result; + } + + // Generate an integer Array containing an arithmetic progression. A port of + // the native Python `range()` function. See + // [the Python documentation](https://docs.python.org/library/functions.html#range). + function range(start, stop, step) { + if (stop == null) { + stop = start || 0; + start = 0; + } + if (!step) { + step = stop < start ? -1 : 1; + } + + var length = Math.max(Math.ceil((stop - start) / step), 0); + var range = Array(length); + + for (var idx = 0; idx < length; idx++, start += step) { + range[idx] = start; + } + + return range; + } + + // Chunk a single array into multiple arrays, each containing `count` or fewer + // items. + function chunk(array, count) { + if (count == null || count < 1) return []; + var result = []; + var i = 0, length = array.length; + while (i < length) { + result.push(slice.call(array, i, i += count)); + } + return result; + } + + // Helper function to continue chaining intermediate results. + function chainResult(instance, obj) { + return instance._chain ? _$1(obj).chain() : obj; + } + + // Add your own custom functions to the Underscore object. + function mixin(obj) { + each(functions(obj), function(name) { + var func = _$1[name] = obj[name]; + _$1.prototype[name] = function() { + var args = [this._wrapped]; + push.apply(args, arguments); + return chainResult(this, func.apply(_$1, args)); + }; + }); + return _$1; + } + + // Add all mutator `Array` functions to the wrapper. + each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { + var method = ArrayProto[name]; + _$1.prototype[name] = function() { + var obj = this._wrapped; + if (obj != null) { + method.apply(obj, arguments); + if ((name === 'shift' || name === 'splice') && obj.length === 0) { + delete obj[0]; + } + } + return chainResult(this, obj); + }; + }); + + // Add all accessor `Array` functions to the wrapper. + each(['concat', 'join', 'slice'], function(name) { + var method = ArrayProto[name]; + _$1.prototype[name] = function() { + var obj = this._wrapped; + if (obj != null) obj = method.apply(obj, arguments); + return chainResult(this, obj); + }; + }); + + // Named Exports + + var allExports = { + __proto__: null, + VERSION: VERSION, + restArguments: restArguments, + isObject: isObject, + isNull: isNull, + isUndefined: isUndefined, + isBoolean: isBoolean, + isElement: isElement, + isString: isString, + isNumber: isNumber, + isDate: isDate, + isRegExp: isRegExp, + isError: isError, + isSymbol: isSymbol, + isArrayBuffer: isArrayBuffer, + isDataView: isDataView$1, + isArray: isArray, + isFunction: isFunction$1, + isArguments: isArguments$1, + isFinite: isFinite$1, + isNaN: isNaN$1, + isTypedArray: isTypedArray$1, + isEmpty: isEmpty, + isMatch: isMatch, + isEqual: isEqual, + isMap: isMap, + isWeakMap: isWeakMap, + isSet: isSet, + isWeakSet: isWeakSet, + keys: keys, + allKeys: allKeys, + values: values, + pairs: pairs, + invert: invert, + functions: functions, + methods: functions, + extend: extend, + extendOwn: extendOwn, + assign: extendOwn, + defaults: defaults, + create: create, + clone: clone, + tap: tap, + get: get, + has: has, + mapObject: mapObject, + identity: identity, + constant: constant, + noop: noop, + toPath: toPath$1, + property: property, + propertyOf: propertyOf, + matcher: matcher, + matches: matcher, + times: times, + random: random, + now: now, + escape: _escape, + unescape: _unescape, + templateSettings: templateSettings, + template: template, + result: result, + uniqueId: uniqueId, + chain: chain, + iteratee: iteratee, + partial: partial, + bind: bind, + bindAll: bindAll, + memoize: memoize, + delay: delay, + defer: defer, + throttle: throttle, + debounce: debounce, + wrap: wrap, + negate: negate, + compose: compose, + after: after, + before: before, + once: once, + findKey: findKey, + findIndex: findIndex, + findLastIndex: findLastIndex, + sortedIndex: sortedIndex, + indexOf: indexOf, + lastIndexOf: lastIndexOf, + find: find, + detect: find, + findWhere: findWhere, + each: each, + forEach: each, + map: map, + collect: map, + reduce: reduce, + foldl: reduce, + inject: reduce, + reduceRight: reduceRight, + foldr: reduceRight, + filter: filter, + select: filter, + reject: reject, + every: every, + all: every, + some: some, + any: some, + contains: contains, + includes: contains, + include: contains, + invoke: invoke, + pluck: pluck, + where: where, + max: max, + min: min, + shuffle: shuffle, + sample: sample, + sortBy: sortBy, + groupBy: groupBy, + indexBy: indexBy, + countBy: countBy, + partition: partition, + toArray: toArray, + size: size, + pick: pick, + omit: omit, + first: first, + head: first, + take: first, + initial: initial, + last: last, + rest: rest, + tail: rest, + drop: rest, + compact: compact, + flatten: flatten, + without: without, + uniq: uniq, + unique: uniq, + union: union, + intersection: intersection, + difference: difference, + unzip: unzip, + transpose: unzip, + zip: zip, + object: object, + range: range, + chunk: chunk, + mixin: mixin, + 'default': _$1 + }; + + // Default Export + + // Add all of the Underscore functions to the wrapper object. + var _ = mixin(allExports); + // Legacy Node.js API. + _._ = _; + + return _; + +}))); +//# sourceMappingURL=underscore-umd.js.map diff --git a/docs/build/html/_static/underscore.js b/docs/build/html/_static/underscore.js index 5b55f32..cf177d4 100644 --- a/docs/build/html/_static/underscore.js +++ b/docs/build/html/_static/underscore.js @@ -1,31 +1,6 @@ -// Underscore.js 1.3.1 -// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. -// Underscore is freely distributable under the MIT license. -// Portions of Underscore are inspired or borrowed from Prototype, -// Oliver Steele's Functional, and John Resig's Micro-Templating. -// For all details and documentation: -// http://documentcloud.github.com/underscore -(function(){function q(a,c,d){if(a===c)return a!==0||1/a==1/c;if(a==null||c==null)return a===c;if(a._chain)a=a._wrapped;if(c._chain)c=c._wrapped;if(a.isEqual&&b.isFunction(a.isEqual))return a.isEqual(c);if(c.isEqual&&b.isFunction(c.isEqual))return c.isEqual(a);var e=l.call(a);if(e!=l.call(c))return false;switch(e){case "[object String]":return a==String(c);case "[object Number]":return a!=+a?c!=+c:a==0?1/a==1/c:a==+c;case "[object Date]":case "[object Boolean]":return+a==+c;case "[object RegExp]":return a.source== -c.source&&a.global==c.global&&a.multiline==c.multiline&&a.ignoreCase==c.ignoreCase}if(typeof a!="object"||typeof c!="object")return false;for(var f=d.length;f--;)if(d[f]==a)return true;d.push(a);var f=0,g=true;if(e=="[object Array]"){if(f=a.length,g=f==c.length)for(;f--;)if(!(g=f in a==f in c&&q(a[f],c[f],d)))break}else{if("constructor"in a!="constructor"in c||a.constructor!=c.constructor)return false;for(var h in a)if(b.has(a,h)&&(f++,!(g=b.has(c,h)&&q(a[h],c[h],d))))break;if(g){for(h in c)if(b.has(c, -h)&&!f--)break;g=!f}}d.pop();return g}var r=this,G=r._,n={},k=Array.prototype,o=Object.prototype,i=k.slice,H=k.unshift,l=o.toString,I=o.hasOwnProperty,w=k.forEach,x=k.map,y=k.reduce,z=k.reduceRight,A=k.filter,B=k.every,C=k.some,p=k.indexOf,D=k.lastIndexOf,o=Array.isArray,J=Object.keys,s=Function.prototype.bind,b=function(a){return new m(a)};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports)exports=module.exports=b;exports._=b}else r._=b;b.VERSION="1.3.1";var j=b.each= -b.forEach=function(a,c,d){if(a!=null)if(w&&a.forEach===w)a.forEach(c,d);else if(a.length===+a.length)for(var e=0,f=a.length;e2;a== -null&&(a=[]);if(y&&a.reduce===y)return e&&(c=b.bind(c,e)),f?a.reduce(c,d):a.reduce(c);j(a,function(a,b,i){f?d=c.call(e,d,a,b,i):(d=a,f=true)});if(!f)throw new TypeError("Reduce of empty array with no initial value");return d};b.reduceRight=b.foldr=function(a,c,d,e){var f=arguments.length>2;a==null&&(a=[]);if(z&&a.reduceRight===z)return e&&(c=b.bind(c,e)),f?a.reduceRight(c,d):a.reduceRight(c);var g=b.toArray(a).reverse();e&&!f&&(c=b.bind(c,e));return f?b.reduce(g,c,d,e):b.reduce(g,c)};b.find=b.detect= -function(a,c,b){var e;E(a,function(a,g,h){if(c.call(b,a,g,h))return e=a,true});return e};b.filter=b.select=function(a,c,b){var e=[];if(a==null)return e;if(A&&a.filter===A)return a.filter(c,b);j(a,function(a,g,h){c.call(b,a,g,h)&&(e[e.length]=a)});return e};b.reject=function(a,c,b){var e=[];if(a==null)return e;j(a,function(a,g,h){c.call(b,a,g,h)||(e[e.length]=a)});return e};b.every=b.all=function(a,c,b){var e=true;if(a==null)return e;if(B&&a.every===B)return a.every(c,b);j(a,function(a,g,h){if(!(e= -e&&c.call(b,a,g,h)))return n});return e};var E=b.some=b.any=function(a,c,d){c||(c=b.identity);var e=false;if(a==null)return e;if(C&&a.some===C)return a.some(c,d);j(a,function(a,b,h){if(e||(e=c.call(d,a,b,h)))return n});return!!e};b.include=b.contains=function(a,c){var b=false;if(a==null)return b;return p&&a.indexOf===p?a.indexOf(c)!=-1:b=E(a,function(a){return a===c})};b.invoke=function(a,c){var d=i.call(arguments,2);return b.map(a,function(a){return(b.isFunction(c)?c||a:a[c]).apply(a,d)})};b.pluck= -function(a,c){return b.map(a,function(a){return a[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);if(!c&&b.isEmpty(a))return-Infinity;var e={computed:-Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b>=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;bd?1:0}),"value")};b.groupBy=function(a,c){var d={},e=b.isFunction(c)?c:function(a){return a[c]};j(a,function(a,b){var c=e(a,b);(d[c]||(d[c]=[])).push(a)});return d};b.sortedIndex=function(a, -c,d){d||(d=b.identity);for(var e=0,f=a.length;e>1;d(a[g])=0})})};b.difference=function(a){var c=b.flatten(i.call(arguments,1));return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a=i.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),e=0;e=0;d--)b=[a[d].apply(this,b)];return b[0]}}; -b.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};b.keys=J||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var c=[],d;for(d in a)b.has(a,d)&&(c[c.length]=d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&&c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]=b[d]});return a};b.defaults=function(a){j(i.call(arguments, -1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return!b.isObject(a)?a:b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,b){return q(a,b,[])};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(b.has(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=o||function(a){return l.call(a)=="[object Array]"};b.isObject=function(a){return a===Object(a)}; -b.isArguments=function(a){return l.call(a)=="[object Arguments]"};if(!b.isArguments(arguments))b.isArguments=function(a){return!(!a||!b.has(a,"callee"))};b.isFunction=function(a){return l.call(a)=="[object Function]"};b.isString=function(a){return l.call(a)=="[object String]"};b.isNumber=function(a){return l.call(a)=="[object Number]"};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===true||a===false||l.call(a)=="[object Boolean]"};b.isDate=function(a){return l.call(a)=="[object Date]"}; -b.isRegExp=function(a){return l.call(a)=="[object RegExp]"};b.isNull=function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.has=function(a,b){return I.call(a,b)};b.noConflict=function(){r._=G;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};b.mixin=function(a){j(b.functions(a), -function(c){K(c,b[c]=a[c])})};var L=0;b.uniqueId=function(a){var b=L++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var t=/.^/,u=function(a){return a.replace(/\\\\/g,"\\").replace(/\\'/g,"'")};b.template=function(a,c){var d=b.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.escape||t,function(a,b){return"',_.escape("+ -u(b)+"),'"}).replace(d.interpolate||t,function(a,b){return"',"+u(b)+",'"}).replace(d.evaluate||t,function(a,b){return"');"+u(b).replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj","_",d);return c?e(c,b):function(a){return e.call(this,a,b)}};b.chain=function(a){return b(a).chain()};var m=function(a){this._wrapped=a};b.prototype=m.prototype;var v=function(a,c){return c?b(a).chain():a},K=function(a,c){m.prototype[a]= -function(){var a=i.call(arguments);H.call(a,this._wrapped);return v(c.apply(b,a),this._chain)}};b.mixin(b);j("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=k[a];m.prototype[a]=function(){var d=this._wrapped;b.apply(d,arguments);var e=d.length;(a=="shift"||a=="splice")&&e===0&&delete d[0];return v(d,this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];m.prototype[a]=function(){return v(b.apply(this._wrapped,arguments),this._chain)}});m.prototype.chain=function(){this._chain= -true;return this};m.prototype.value=function(){return this._wrapped}}).call(this); +!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define("underscore",r):(n="undefined"!=typeof globalThis?globalThis:n||self,function(){var t=n._,e=n._=r();e.noConflict=function(){return n._=t,e}}())}(this,(function(){ +// Underscore.js 1.13.1 +// https://underscorejs.org +// (c) 2009-2021 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors +// Underscore may be freely distributed under the MIT license. +var n="1.13.1",r="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},t=Array.prototype,e=Object.prototype,u="undefined"!=typeof Symbol?Symbol.prototype:null,o=t.push,i=t.slice,a=e.toString,f=e.hasOwnProperty,c="undefined"!=typeof ArrayBuffer,l="undefined"!=typeof DataView,s=Array.isArray,p=Object.keys,v=Object.create,h=c&&ArrayBuffer.isView,y=isNaN,d=isFinite,g=!{toString:null}.propertyIsEnumerable("toString"),b=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],m=Math.pow(2,53)-1;function j(n,r){return r=null==r?n.length-1:+r,function(){for(var t=Math.max(arguments.length-r,0),e=Array(t),u=0;u=0&&t<=m}}function J(n){return function(r){return null==r?void 0:r[n]}}var G=J("byteLength"),H=K(G),Q=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;var X=c?function(n){return h?h(n)&&!q(n):H(n)&&Q.test(a.call(n))}:C(!1),Y=J("length");function Z(n,r){r=function(n){for(var r={},t=n.length,e=0;e":">",'"':""","'":"'","`":"`"},Cn=Ln($n),Kn=Ln(_n($n)),Jn=tn.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},Gn=/(.)^/,Hn={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Qn=/\\|'|\r|\n|\u2028|\u2029/g;function Xn(n){return"\\"+Hn[n]}var Yn=/^\s*(\w|\$)+\s*$/;var Zn=0;function nr(n,r,t,e,u){if(!(e instanceof r))return n.apply(t,u);var o=Mn(n.prototype),i=n.apply(o,u);return _(i)?i:o}var rr=j((function(n,r){var t=rr.placeholder,e=function(){for(var u=0,o=r.length,i=Array(o),a=0;a1)ur(a,r-1,t,e),u=e.length;else for(var f=0,c=a.length;f0&&(t=r.apply(this,arguments)),n<=1&&(r=null),t}}var lr=rr(cr,2);function sr(n,r,t){r=qn(r,t);for(var e,u=nn(n),o=0,i=u.length;o0?0:u-1;o>=0&&o0?a=o>=0?o:Math.max(o+f,a):f=o>=0?Math.min(o+1,f):o+f+1;else if(t&&o&&f)return e[o=t(e,u)]===u?o:-1;if(u!=u)return(o=r(i.call(e,a,f),$))>=0?o+a:-1;for(o=n>0?a:f-1;o>=0&&o0?0:i-1;for(u||(e=r[o?o[a]:a],a+=n);a>=0&&a=3;return r(n,Fn(t,u,4),e,o)}}var Ar=wr(1),xr=wr(-1);function Sr(n,r,t){var e=[];return r=qn(r,t),jr(n,(function(n,t,u){r(n,t,u)&&e.push(n)})),e}function Or(n,r,t){r=qn(r,t);for(var e=!er(n)&&nn(n),u=(e||n).length,o=0;o=0}var Br=j((function(n,r,t){var e,u;return D(r)?u=r:(r=Nn(r),e=r.slice(0,-1),r=r[r.length-1]),_r(n,(function(n){var o=u;if(!o){if(e&&e.length&&(n=In(n,e)),null==n)return;o=n[r]}return null==o?o:o.apply(n,t)}))}));function Nr(n,r){return _r(n,Rn(r))}function Ir(n,r,t){var e,u,o=-1/0,i=-1/0;if(null==r||"number"==typeof r&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=er(n)?n:jn(n)).length;ao&&(o=e);else r=qn(r,t),jr(n,(function(n,t,e){((u=r(n,t,e))>i||u===-1/0&&o===-1/0)&&(o=n,i=u)}));return o}function Tr(n,r,t){if(null==r||t)return er(n)||(n=jn(n)),n[Wn(n.length-1)];var e=er(n)?En(n):jn(n),u=Y(e);r=Math.max(Math.min(r,u),0);for(var o=u-1,i=0;i1&&(e=Fn(e,r[1])),r=an(n)):(e=qr,r=ur(r,!1,!1),n=Object(n));for(var u=0,o=r.length;u1&&(t=r[1])):(r=_r(ur(r,!1,!1),String),e=function(n,t){return!Er(r,t)}),Ur(n,e,t)}));function zr(n,r,t){return i.call(n,0,Math.max(0,n.length-(null==r||t?1:r)))}function Lr(n,r,t){return null==n||n.length<1?null==r||t?void 0:[]:null==r||t?n[0]:zr(n,n.length-r)}function $r(n,r,t){return i.call(n,null==r||t?1:r)}var Cr=j((function(n,r){return r=ur(r,!0,!0),Sr(n,(function(n){return!Er(r,n)}))})),Kr=j((function(n,r){return Cr(n,r)}));function Jr(n,r,t,e){A(r)||(e=t,t=r,r=!1),null!=t&&(t=qn(t,e));for(var u=[],o=[],i=0,a=Y(n);ir?(e&&(clearTimeout(e),e=null),a=c,i=n.apply(u,o),e||(u=o=null)):e||!1===t.trailing||(e=setTimeout(f,l)),i};return c.cancel=function(){clearTimeout(e),a=0,e=u=o=null},c},debounce:function(n,r,t){var e,u,o,i,a,f=function(){var c=zn()-u;r>c?e=setTimeout(f,r-c):(e=null,t||(i=n.apply(a,o)),e||(o=a=null))},c=j((function(c){return a=this,o=c,u=zn(),e||(e=setTimeout(f,r),t&&(i=n.apply(a,o))),i}));return c.cancel=function(){clearTimeout(e),e=o=a=null},c},wrap:function(n,r){return rr(r,n)},negate:fr,compose:function(){var n=arguments,r=n.length-1;return function(){for(var t=r,e=n[r].apply(this,arguments);t--;)e=n[t].call(this,e);return e}},after:function(n,r){return function(){if(--n<1)return r.apply(this,arguments)}},before:cr,once:lr,findKey:sr,findIndex:vr,findLastIndex:hr,sortedIndex:yr,indexOf:gr,lastIndexOf:br,find:mr,detect:mr,findWhere:function(n,r){return mr(n,Dn(r))},each:jr,forEach:jr,map:_r,collect:_r,reduce:Ar,foldl:Ar,inject:Ar,reduceRight:xr,foldr:xr,filter:Sr,select:Sr,reject:function(n,r,t){return Sr(n,fr(qn(r)),t)},every:Or,all:Or,some:Mr,any:Mr,contains:Er,includes:Er,include:Er,invoke:Br,pluck:Nr,where:function(n,r){return Sr(n,Dn(r))},max:Ir,min:function(n,r,t){var e,u,o=1/0,i=1/0;if(null==r||"number"==typeof r&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=er(n)?n:jn(n)).length;ae||void 0===t)return 1;if(t - adobe package — pdfservices-sdk documentation - + adobe package — pdfservices-sdk documentation + + - + + @@ -62,7 +64,7 @@
  • Exceptions
  • @@ -93,9 +95,9 @@
    -

    adobe package

    +

    adobe package

    -

    Subpackages

    +

    Subpackages

    diff --git a/docs/build/html/adobe.pdfservices.html b/docs/build/html/adobe.pdfservices.html index 9c5dba6..f6ab9bb 100644 --- a/docs/build/html/adobe.pdfservices.html +++ b/docs/build/html/adobe.pdfservices.html @@ -3,13 +3,15 @@ - adobe.pdfservices package — pdfservices-sdk documentation - + adobe.pdfservices package — pdfservices-sdk documentation + + - + + @@ -62,7 +64,7 @@
  • Exceptions
  • @@ -93,9 +95,9 @@
    -

    adobe.pdfservices package

    +

    adobe.pdfservices package

    -

    Subpackages

    +

    Subpackages

    diff --git a/docs/build/html/adobe.pdfservices.operation.auth.html b/docs/build/html/adobe.pdfservices.operation.auth.html index 5d13a8d..d7a8177 100644 --- a/docs/build/html/adobe.pdfservices.operation.auth.html +++ b/docs/build/html/adobe.pdfservices.operation.auth.html @@ -3,13 +3,15 @@ - adobe.pdfservices.operation.auth package — pdfservices-sdk documentation - + adobe.pdfservices.operation.auth package — pdfservices-sdk documentation + + - + + @@ -62,7 +64,7 @@
  • Exceptions
  • @@ -93,28 +95,28 @@
    -

    adobe.pdfservices.operation.auth package

    +

    adobe.pdfservices.operation.auth package

    -

    Submodules

    +

    Submodules

    -

    adobe.pdfservices.operation.auth.credentials module

    +

    adobe.pdfservices.operation.auth.credentials module

    -
    -class adobe.pdfservices.operation.auth.credentials.Credentials
    +
    +class adobe.pdfservices.operation.auth.credentials.Credentials

    Bases: abc.ABC

    Marker base class for different types of credentials. Currently it supports only ServiceAccountCredentials. The factory methods within this class can be used to create instances of credentials classes.

    -
    -static service_account_credentials_builder()
    +
    +static service_account_credentials_builder()

    Creates a new ServiceAccountCredentials builder.

    Returns

    An instance of ServiceAccountCredentials Builder.

    Return type
    -

    ServiceAccountCredentials.Builder

    +

    ServiceAccountCredentials.Builder

    @@ -123,22 +125,22 @@

    Submodules -

    adobe.pdfservices.operation.auth.service_account_credentials module

    +

    adobe.pdfservices.operation.auth.service_account_credentials module

    -
    -class adobe.pdfservices.operation.auth.service_account_credentials.ServiceAccountCredentials(client_id, client_secret, private_key, organization_id, account_id, ims_base_uri=adobe.pdfservices.operation.internal.service_constants.ServiceConstants.JWT_BASE_URI, claim=None)
    +
    +class adobe.pdfservices.operation.auth.service_account_credentials.ServiceAccountCredentials(client_id, client_secret, private_key, organization_id, account_id, ims_base_uri=adobe.pdfservices.operation.internal.constants.service_constants.ServiceConstants.JWT_BASE_URI, claim=None)

    Bases: adobe.pdfservices.operation.auth.credentials.Credentials, abc.ABC

    Service Account credentials allow your application to call PDF Tools Extract API on behalf of the application itself, or on behalf of an enterprise organization. For getting the credentials, Click Here.

    -
    -class Builder
    +
    +class Builder

    Bases: object

    Builds a ServiceAccountCredentials instance.

    -
    -build()
    +
    +build()

    Returns a new ServiceAccountCredentials instance built from the current state of this builder.

    Returns
    @@ -151,8 +153,8 @@

    Submodules -
    -from_file(credentials_file_path: str)
    +
    +from_file(credentials_file_path: str)

    Sets Service Account Credentials using the JSON credentials file path. All the keys in the JSON structure are optional.

    JSON structure:

    Return type
    -

    ServiceAccountCredentials.Builder

    +

    ServiceAccountCredentials.Builder

    -
    -with_account_id(account_id: str)
    +
    +with_account_id(account_id: str)

    Set Account Id (format: id@techacct.adobe.com)

    Parameters
    @@ -194,14 +196,14 @@

    Submodules

    This Builder instance to add any additional parameters.

    Return type
    -

    ServiceAccountCredentials.Builder

    +

    ServiceAccountCredentials.Builder

    -
    -with_client_id(client_id: str)
    +
    +with_client_id(client_id: str)

    Set Client ID (API Key)

    Parameters
    @@ -211,14 +213,14 @@

    Submodules

    This Builder instance to add any additional parameters.

    Return type
    -

    ServiceAccountCredentials.Builder

    +

    ServiceAccountCredentials.Builder

    -
    -with_client_secret(client_secret: str)
    +
    +with_client_secret(client_secret: str)

    Set Client Secret

    Parameters
    @@ -228,14 +230,14 @@

    Submodules

    This Builder instance to add any additional parameters.

    Return type
    -

    ServiceAccountCredentials.Builder

    +

    ServiceAccountCredentials.Builder

    -
    -with_organization_id(organization_id: str)
    +
    +with_organization_id(organization_id: str)

    Set Organization Id (format: org_ident@AdobeOrg) that has been configured for access to PDF Tools API

    Parameters
    @@ -245,14 +247,14 @@

    Submodules

    This Builder instance to add any additional parameters.

    Return type
    -

    ServiceAccountCredentials.Builder

    +

    ServiceAccountCredentials.Builder

    -
    -with_private_key(private_key: str)
    +
    +with_private_key(private_key: str)

    Set private key

    Parameters
    @@ -262,46 +264,46 @@

    Submodules

    This Builder instance to add any additional parameters.

    Return type
    -

    ServiceAccountCredentials.Builder

    +

    ServiceAccountCredentials.Builder

    -
    -
    -property account_id
    +
    +
    +property account_id

    Account ID(format: id@techacct.adobe.com)

    -
    -
    -property claim
    +
    +
    +property claim

    Identifies the Service for which Authorization(Access) Token will be issued

    -
    -
    -property client_id
    +
    +
    +property client_id

    Client Id (API Key)

    -
    -
    -property client_secret
    +
    +
    +property client_secret

    Client Secret

    -
    -
    -property organization_id
    +
    +
    +property organization_id

    Identifies the organization(format: org_ident@AdobeOrg) that has been configured for access to PDF Tools API.

    -
    -
    -property private_key
    +
    +
    +property private_key

    Content of the Private Key (PEM format)

    @@ -309,7 +311,7 @@

    Submodules -

    Module contents

    +

    Module contents

    diff --git a/docs/build/html/adobe.pdfservices.operation.exception.html b/docs/build/html/adobe.pdfservices.operation.exception.html index 5318f97..9f51d26 100644 --- a/docs/build/html/adobe.pdfservices.operation.exception.html +++ b/docs/build/html/adobe.pdfservices.operation.exception.html @@ -3,13 +3,15 @@ - adobe.pdfservices.operation.exception package — pdfservices-sdk documentation - + adobe.pdfservices.operation.exception package — pdfservices-sdk documentation + + - + + @@ -62,7 +64,7 @@
  • Exceptions
  • @@ -93,94 +95,94 @@
    -

    adobe.pdfservices.operation.exception package

    +

    adobe.pdfservices.operation.exception package

    -

    Submodules

    +

    Submodules

    -

    adobe.pdfservices.operation.exception.exceptions module

    +

    adobe.pdfservices.operation.exception.exceptions module

    -
    -exception adobe.pdfservices.operation.exception.exceptions.SdkException(message, request_tracking_id=None)
    +
    +exception adobe.pdfservices.operation.exception.exceptions.SdkException(message, request_tracking_id=None)

    Bases: Exception

    SdkException is typically thrown for client-side or network errors.

    -
    -
    -property request_tracking_id
    +
    +
    +property request_tracking_id

    The request tracking id of the exception.

    -
    -exception adobe.pdfservices.operation.exception.exceptions.ServiceApiException(message, request_tracking_id, status_code=0, error_code='UNKNOWN')
    +
    +exception adobe.pdfservices.operation.exception.exceptions.ServiceApiException(message, request_tracking_id, status_code=0, error_code='UNKNOWN')

    Bases: Exception

    ServiceApiException is thrown when an underlying service API call results in an error.

    -
    -DEFAULT_ERROR_CODE = 'UNKNOWN'
    +
    +DEFAULT_ERROR_CODE = 'UNKNOWN'

    Returns the HTTP Status code or DEFAULT_STATUS_CODE if the status code doesn’t adequately represent the error.

    -
    -DEFAULT_STATUS_CODE = 0
    +
    +DEFAULT_STATUS_CODE = 0

    The default value of status code if there is no status code for this service exception.

    -
    -
    -property error_code
    +
    +
    +property error_code

    Returns the detailed message of this error.

    -
    -
    -property request_tracking_id
    +
    +
    +property request_tracking_id

    The request tracking id of the exception.

    -
    -
    -property status_code
    +
    +
    +property status_code

    Returns the HTTP Status code or DEFAULT_STATUS_CODE if the status code doesn’t adequately represent the error.

    -
    -exception adobe.pdfservices.operation.exception.exceptions.ServiceUsageException(message, request_tracking_id, status_code=429, error_code='UNKNOWN')
    +
    +exception adobe.pdfservices.operation.exception.exceptions.ServiceUsageException(message, request_tracking_id, status_code=429, error_code='UNKNOWN')

    Bases: Exception

    ServiceUsageError is thrown when either service usage limit has been reached or credentials quota has been exhausted.

    -
    -DEFAULT_ERROR_CODE = 'UNKNOWN'
    +
    +DEFAULT_ERROR_CODE = 'UNKNOWN'

    The default value of error code if there is no status code for this service failure.

    -
    -DEFAULT_STATUS_CODE = 429
    +
    +DEFAULT_STATUS_CODE = 429

    The default value of status code if there is no status code for this service failure.

    -
    -
    -property error_code
    +
    +
    +property error_code

    Returns the detailed message of this error.

    -
    -
    -property request_tracking_id
    +
    +
    +property request_tracking_id

    The request tracking id of the exception.

    -
    -
    -property status_code
    +
    +
    +property status_code

    Returns the HTTP Status code or DEFAULT_STATUS_CODE if the status code doesn’t adequately represent the error.

    @@ -188,7 +190,7 @@

    Submodules -

    Module contents

    +

    Module contents

    diff --git a/docs/build/html/adobe.pdfservices.operation.html b/docs/build/html/adobe.pdfservices.operation.html index 7fac2a2..86b4270 100644 --- a/docs/build/html/adobe.pdfservices.operation.html +++ b/docs/build/html/adobe.pdfservices.operation.html @@ -3,13 +3,15 @@ - adobe.pdfservices.operation package — pdfservices-sdk documentation - + adobe.pdfservices.operation package — pdfservices-sdk documentation + + - + + @@ -62,7 +64,7 @@
  • Exceptions
  • @@ -93,9 +95,9 @@
    -

    adobe.pdfservices.operation package

    +

    adobe.pdfservices.operation package

    -

    Subpackages

    +

    Subpackages

    -

    adobe.pdfservices.operation.client_config module

    +

    adobe.pdfservices.operation.client_config module

    -
    -class adobe.pdfservices.operation.client_config.ClientConfig
    +
    +class adobe.pdfservices.operation.client_config.ClientConfig

    Bases: object

    Encapsulates the API request configurations

    -
    -class Builder
    +
    +class Builder

    Bases: object

    Builds a ClientConfig instance.

    -
    -build()
    +
    +build()

    Returns a new ClientConfig instance built from the current state of this builder.

    Returns
    @@ -164,8 +166,8 @@

    Submodules -
    -from_file(client_config_file_path: str)
    +
    +from_file(client_config_file_path: str)

    Sets the connect timeout and read timeout using the JSON client config file path. All the keys in the JSON structure are optional.

    Parameters
    @@ -188,8 +190,8 @@

    Submodules -
    -with_connect_timeout(connect_timeout: int)
    +
    +with_connect_timeout(connect_timeout: int)

    Sets the connect timeout. It should be greater than zero.

    Parameters
    @@ -205,8 +207,25 @@

    Submodules -
    -with_read_timeout(read_timeout: int)
    +
    +with_pdf_services_uri(pdf_services_uri: str)
    +

    Sets the pdf services uri link.

    +
    +
    Parameters
    +

    pdf_services_uri (str) – url for the new rest api

    +
    +
    Returns
    +

    This Builder instance to add any additional parameters.

    +
    +
    Return type
    +

    ClientConfig.Builder

    +
    +
    +

    + +
    +
    +with_read_timeout(read_timeout: int)

    Sets the read timeout. It should be greater than zero.

    Parameters
    @@ -224,8 +243,8 @@

    Submodules -
    -static builder()
    +
    +static builder()

    Creates a new ClientConfig builder.

    Returns
    @@ -241,10 +260,10 @@

    Submodules -

    adobe.pdfservices.operation.execution_context module

    +

    adobe.pdfservices.operation.execution_context module

    -
    -class adobe.pdfservices.operation.execution_context.ExecutionContext
    +
    +class adobe.pdfservices.operation.execution_context.ExecutionContext

    Bases: object

    Represents the execution context of an Operation. An execution context typically consists of the desired authentication credentials and client configurations such as timeouts.

    @@ -278,8 +297,8 @@

    Submodules -
    -static create(credentials: adobe.pdfservices.operation.auth.credentials.Credentials, client_config: Optional[adobe.pdfservices.operation.client_config.ClientConfig] = None)
    +
    +static create(credentials: adobe.pdfservices.operation.auth.credentials.Credentials, client_config: Optional[adobe.pdfservices.operation.client_config.ClientConfig] = None)

    Creates a context instance using the provided Credentials and ClientConfig

    Parameters
    @@ -301,21 +320,21 @@

    Submodules -

    adobe.pdfservices.operation.operation module

    +

    adobe.pdfservices.operation.operation module

    -
    -class adobe.pdfservices.operation.operation.Operation
    +
    +class adobe.pdfservices.operation.operation.Operation

    Bases: abc.ABC

    -
    -abstract execute(execution_context: adobe.pdfservices.operation.execution_context.ExecutionContext)
    +
    +abstract execute(execution_context: adobe.pdfservices.operation.execution_context.ExecutionContext)

    -

    Module contents

    +

    Module contents

    diff --git a/docs/build/html/adobe.pdfservices.operation.io.html b/docs/build/html/adobe.pdfservices.operation.io.html index cfae53f..6236b40 100644 --- a/docs/build/html/adobe.pdfservices.operation.io.html +++ b/docs/build/html/adobe.pdfservices.operation.io.html @@ -3,13 +3,15 @@ - adobe.pdfservices.operation.io package — pdfservices-sdk documentation - + adobe.pdfservices.operation.io package — pdfservices-sdk documentation + + - + + @@ -62,7 +64,7 @@
  • Exceptions
  • @@ -93,22 +95,22 @@
    -

    adobe.pdfservices.operation.io package

    +

    adobe.pdfservices.operation.io package

    -

    Submodules

    +

    Submodules

    -

    adobe.pdfservices.operation.io.file_ref module

    +

    adobe.pdfservices.operation.io.file_ref module

    -
    -class adobe.pdfservices.operation.io.file_ref.FileRef
    +
    +class adobe.pdfservices.operation.io.file_ref.FileRef

    Bases: abc.ABC

    This class represents a local file. It is typically used by an SDK Operation which accepts or returns files.

    When a FileRef instance is created by this SDK while referring to a temporary file location, calling any of the methods to save the fileRef (For example, create_from_stream() etc.) will delete the temporary file.

    -
    -static create_from_local_file(local_source: str, media_type: Optional[str] = None)
    +
    +static create_from_local_file(local_source: str, media_type: Optional[str] = None)

    Creates a FileRef instance from a local file path. If no media type is provided, it will be inferred from the file extension.

    @@ -128,8 +130,8 @@

    Submodules -
    -static create_from_stream(input_stream: _io.BufferedReader, media_type: str)
    +
    +static create_from_stream(input_stream: _io.BufferedReader, media_type: str)

    Creates a FileRef instance from a readable stream using the specified media type. The stream is not read by this method but by consumers of file content i.e. the execute method of an operation such as execute().

    @@ -150,20 +152,26 @@

    Submodules -
    -abstract save_as(local_file_path: str)
    +
    +get_media_type()
    +

    returns the media type

    +

    + +
    +
    +abstract save_as(local_file_path: str)
    -
    -abstract write_to_stream(writer_stream)
    +
    +abstract write_to_stream(writer_stream)
    -

    Module contents

    +

    Module contents

    diff --git a/docs/build/html/adobe.pdfservices.operation.pdfops.html b/docs/build/html/adobe.pdfservices.operation.pdfops.html index b00208d..9fc2fd6 100644 --- a/docs/build/html/adobe.pdfservices.operation.pdfops.html +++ b/docs/build/html/adobe.pdfservices.operation.pdfops.html @@ -3,13 +3,15 @@ - adobe.pdfservices.operation.pdfops package — pdfservices-sdk documentation - + adobe.pdfservices.operation.pdfops package — pdfservices-sdk documentation + + - + + @@ -62,7 +64,7 @@
  • Exceptions
  • @@ -93,9 +95,9 @@
    -

    adobe.pdfservices.operation.pdfops package

    +

    adobe.pdfservices.operation.pdfops package

    -

    Subpackages

    +

    Subpackages

    -

    adobe.pdfservices.operation.pdfops.extract_pdf_operation module

    +

    adobe.pdfservices.operation.pdfops.extract_pdf_operation module

    -
    -class adobe.pdfservices.operation.pdfops.extract_pdf_operation.ExtractPDFOperation(create_key)
    +
    +class adobe.pdfservices.operation.pdfops.extract_pdf_operation.ExtractPDFOperation(create_key)

    Bases: adobe.pdfservices.operation.operation.Operation

    An Operation that extracts pdf elements such as text and tables in a structured format from a PDF, along with renditions for tables and figures.

    @@ -158,14 +160,14 @@

    Submodules -
    -SUPPORTED_SOURCE_MEDIA_TYPES = {adobe.pdfservices.operation.internal.extension_media_type_mapping.ExtensionMediaTypeMapping.PDF.mime_type}
    +
    +SUPPORTED_SOURCE_MEDIA_TYPES = {adobe.pdfservices.operation.internal.extension_media_type_mapping.ExtensionMediaTypeMapping.PDF.mime_type}

    Supported source file formats for ExtractPdfOperation is .pdf.

    -
    -classmethod create_new()
    +
    +classmethod create_new()

    creates a new instance of ExtractPDFOperation.

    Returns
    @@ -178,8 +180,8 @@

    Submodules -
    -execute(execution_context: adobe.pdfservices.operation.execution_context.ExecutionContext)
    +
    +execute(execution_context: adobe.pdfservices.operation.execution_context.ExecutionContext)

    Executes this operation synchronously using the supplied context and returns a new FileRef instance for the resulting Zip file. The resulting file may be stored in the system temporary directory. See adobe.pdfservices.operation.io.file_ref.FileRef for how temporary resources are cleaned up.

    @@ -199,8 +201,22 @@

    Submodules -
    -set_input(source_file_ref: adobe.pdfservices.operation.io.file_ref.FileRef)
    +
    +get_options()
    +

    gets the ExtractPDFOptions.

    +
    +
    Returns
    +

    The options parameter of the operation

    +
    +
    Return type
    +

    ExtractPDFOptions

    +
    +
    +

    + +
    +
    +set_input(source_file_ref: adobe.pdfservices.operation.io.file_ref.FileRef)

    Sets an input file.

    Parameters
    @@ -216,8 +232,8 @@

    Submodules -
    -set_options(extract_pdf_options: adobe.pdfservices.operation.pdfops.options.extractpdf.extract_pdf_options.ExtractPDFOptions)
    +
    +set_options(extract_pdf_options: adobe.pdfservices.operation.pdfops.options.extractpdf.extract_pdf_options.ExtractPDFOptions)

    sets the ExtractPDFOptions.

    Parameters
    @@ -236,7 +252,7 @@

    Submodules -

    Module contents

    +

    Module contents

    diff --git a/docs/build/html/adobe.pdfservices.operation.pdfops.options.extractpdf.html b/docs/build/html/adobe.pdfservices.operation.pdfops.options.extractpdf.html index a047d07..2265df3 100644 --- a/docs/build/html/adobe.pdfservices.operation.pdfops.options.extractpdf.html +++ b/docs/build/html/adobe.pdfservices.operation.pdfops.options.extractpdf.html @@ -3,13 +3,15 @@ - adobe.pdfservices.operation.pdfops.options.extractpdf package — pdfservices-sdk documentation - + adobe.pdfservices.operation.pdfops.options.extractpdf package — pdfservices-sdk documentation + + - + + @@ -62,7 +64,7 @@
  • Exceptions
  • @@ -93,15 +95,15 @@
    -

    adobe.pdfservices.operation.pdfops.options.extractpdf package

    +

    adobe.pdfservices.operation.pdfops.options.extractpdf package

    -

    Submodules

    +

    Submodules

    -

    adobe.pdfservices.operation.pdfops.options.extractpdf.extract_pdf_options module

    +

    adobe.pdfservices.operation.pdfops.options.extractpdf.extract_pdf_options module

    -
    -class adobe.pdfservices.operation.pdfops.options.extractpdf.extract_pdf_options.ExtractPDFOptions(elements_to_extract, elements_to_extract_renditions, get_char_info, table_output_format, include_styling_info=None)
    +
    +class adobe.pdfservices.operation.pdfops.options.extractpdf.extract_pdf_options.ExtractPDFOptions(elements_to_extract, elements_to_extract_renditions, get_char_info, table_output_format, include_styling_info=None)

    Bases: object

    An Options Class that defines the options for ExtractPDFOperation.

    extract_pdf_options: ExtractPDFOptions = ExtractPDFOptions.builder() \
    @@ -114,18 +116,18 @@ 

    Submodules -
    -class Builder
    +
    +class Builder

    Bases: object

    The builder for ExtractPDFOptions.

    -
    -build()
    +
    +build()
    -
    -with_element_to_extract(element_to_extract: adobe.pdfservices.operation.pdfops.options.extractpdf.extract_element_type.ExtractElementType)
    +
    +with_element_to_extract(element_to_extract: adobe.pdfservices.operation.pdfops.options.extractpdf.extract_element_type.ExtractElementType)

    adds a pdf element type for extracting structured information.

    Parameters
    @@ -144,8 +146,8 @@

    Submodules -
    -with_element_to_extract_renditions(element_to_extract_renditions: adobe.pdfservices.operation.pdfops.options.extractpdf.extract_renditions_element_type.ExtractRenditionsElementType)
    +
    +with_element_to_extract_renditions(element_to_extract_renditions: adobe.pdfservices.operation.pdfops.options.extractpdf.extract_renditions_element_type.ExtractRenditionsElementType)

    adds a pdf element type for extracting rendition.

    Parameters
    @@ -164,8 +166,8 @@

    Submodules -
    -with_elements_to_extract(elements_to_extract: List[adobe.pdfservices.operation.pdfops.options.extractpdf.extract_element_type.ExtractElementType])
    +
    +with_elements_to_extract(elements_to_extract: List[adobe.pdfservices.operation.pdfops.options.extractpdf.extract_element_type.ExtractElementType])

    adds a list of pdf element types for extracting structured information.

    Parameters
    @@ -184,8 +186,8 @@

    Submodules -
    -with_elements_to_extract_renditions(elements_to_extract_renditions: List[adobe.pdfservices.operation.pdfops.options.extractpdf.extract_renditions_element_type.ExtractRenditionsElementType])
    +
    +with_elements_to_extract_renditions(elements_to_extract_renditions: List[adobe.pdfservices.operation.pdfops.options.extractpdf.extract_renditions_element_type.ExtractRenditionsElementType])

    adds a list of pdf element types for extracting rendition.

    Parameters
    @@ -204,8 +206,8 @@

    Submodules -
    -with_get_char_info(get_char_info: bool)
    +
    +with_get_char_info(get_char_info: bool)

    sets the Boolean specifying whether to add character level bounding boxes to output json

    Parameters
    @@ -221,8 +223,8 @@

    Submodules -
    -with_include_styling_info(include_styling_info: bool)
    +
    +with_include_styling_info(include_styling_info: bool)

    sets the Boolean specifying whether to add PDF Elements Styling Info to output json

    Parameters
    @@ -238,8 +240,8 @@

    Submodules -
    -with_table_structure_format(table_structure: adobe.pdfservices.operation.pdfops.options.extractpdf.table_structure_type.TableStructureType)
    +
    +with_table_structure_format(table_structure: adobe.pdfservices.operation.pdfops.options.extractpdf.table_structure_type.TableStructureType)

    adds the table structure format (currently csv only) for extracting structured information.

    Parameters
    @@ -260,8 +262,8 @@

    Submodules -
    -static builder()
    +
    +static builder()

    Returns a Builder for ExtractPDFOptions

    Returns
    @@ -273,33 +275,33 @@

    Submodules -
    -property elements_to_extract
    +
    +
    +property elements_to_extract

    List of pdf element types to be extracted in a structured format from input file

    -
    -
    -property elements_to_extract_renditions
    +
    +
    +property elements_to_extract_renditions

    List of pdf element types whose renditions needs to be extracted from input file

    -
    -
    -property get_char_info
    +
    +
    +property get_char_info

    Boolean specifying whether to add character level bounding boxes to output json

    -
    -
    -property include_styling_info
    +
    +
    +property include_styling_info

    Boolean specifying whether to add PDF Elements Styling Info to output json

    -
    -
    -property table_output_format
    +
    +
    +property table_output_format

    export table in specified format - currently csv supported

    @@ -307,62 +309,62 @@

    Submodules -

    adobe.pdfservices.operation.pdfops.options.extractpdf.extract_element_type module

    +

    adobe.pdfservices.operation.pdfops.options.extractpdf.extract_element_type module

    -
    -class adobe.pdfservices.operation.pdfops.options.extractpdf.extract_element_type.ExtractElementType(value)
    +
    +class adobe.pdfservices.operation.pdfops.options.extractpdf.extract_element_type.ExtractElementType(value)

    Bases: str, enum.Enum

    enum of ElementTypes in a PDF which can be extracted as json.

    -
    -TABLES = 'tables'
    +
    +TABLES = 'tables'
    -
    -TEXT = 'text'
    +
    +TEXT = 'text'

    -

    adobe.pdfservices.operation.pdfops.options.extractpdf.extract_renditions_element_type module

    +

    adobe.pdfservices.operation.pdfops.options.extractpdf.extract_renditions_element_type module

    -
    -class adobe.pdfservices.operation.pdfops.options.extractpdf.extract_renditions_element_type.ExtractRenditionsElementType(value)
    +
    +class adobe.pdfservices.operation.pdfops.options.extractpdf.extract_renditions_element_type.ExtractRenditionsElementType(value)

    Bases: str, enum.Enum

    enum of ElementTypes in a PDF which can be extracted as renditions.

    -
    -FIGURES = 'figures'
    +
    +FIGURES = 'figures'
    -
    -TABLES = 'tables'
    +
    +TABLES = 'tables'
    -

    adobe.pdfservices.operation.pdfops.options.extractpdf.table_structure_type module

    +

    adobe.pdfservices.operation.pdfops.options.extractpdf.table_structure_type module

    -
    -class adobe.pdfservices.operation.pdfops.options.extractpdf.table_structure_type.TableStructureType(value)
    +
    +class adobe.pdfservices.operation.pdfops.options.extractpdf.table_structure_type.TableStructureType(value)

    Bases: str, enum.Enum

    enum of TableStructureType in a PDF.

    -
    -CSV = 'csv'
    +
    +CSV = 'csv'
    -

    Module contents

    +

    Module contents

    diff --git a/docs/build/html/adobe.pdfservices.operation.pdfops.options.html b/docs/build/html/adobe.pdfservices.operation.pdfops.options.html index 2f8d9e9..bbda18c 100644 --- a/docs/build/html/adobe.pdfservices.operation.pdfops.options.html +++ b/docs/build/html/adobe.pdfservices.operation.pdfops.options.html @@ -3,13 +3,15 @@ - adobe.pdfservices.operation.pdfops.options package — pdfservices-sdk documentation - + adobe.pdfservices.operation.pdfops.options package — pdfservices-sdk documentation + + - + + @@ -62,7 +64,7 @@
  • Exceptions
  • @@ -93,9 +95,9 @@
    -

    adobe.pdfservices.operation.pdfops.options package

    +

    adobe.pdfservices.operation.pdfops.options package

    -

    Subpackages

    +

    Subpackages

    diff --git a/docs/build/html/genindex.html b/docs/build/html/genindex.html index aa10538..b58d14b 100644 --- a/docs/build/html/genindex.html +++ b/docs/build/html/genindex.html @@ -3,13 +3,15 @@ - Index — pdfservices-sdk documentation - + Index — pdfservices-sdk documentation + + - + + @@ -62,7 +64,7 @@
  • Exceptions
  • @@ -116,7 +118,7 @@

    Index

    A

      -
    • account_id() (adobe.pdfservices.operation.auth.service_account_credentials.ServiceAccountCredentials property), [1] +
    • account_id (adobe.pdfservices.operation.auth.service_account_credentials.ServiceAccountCredentials property), [1]
    • adobe @@ -279,7 +281,7 @@

      A

      B

        -
      • Builder (class in adobe.pdfservices.operation.auth.service_account_credentials.ServiceAccountCredentials) +
      • Builder (class in adobe.pdfservices.operation.auth.service_account_credentials.ServiceAccountCredentials)
        • (class in adobe.pdfservices.operation.client_config.ClientConfig) @@ -311,11 +313,11 @@

          B

          C

            -
          • claim() (adobe.pdfservices.operation.auth.service_account_credentials.ServiceAccountCredentials property), [1] +
          • claim (adobe.pdfservices.operation.auth.service_account_credentials.ServiceAccountCredentials property), [1]
          • -
          • client_id() (adobe.pdfservices.operation.auth.service_account_credentials.ServiceAccountCredentials property), [1] +
          • client_id (adobe.pdfservices.operation.auth.service_account_credentials.ServiceAccountCredentials property), [1]
          • -
          • client_secret() (adobe.pdfservices.operation.auth.service_account_credentials.ServiceAccountCredentials property), [1] +
          • client_secret (adobe.pdfservices.operation.auth.service_account_credentials.ServiceAccountCredentials property), [1]
          • ClientConfig (class in adobe.pdfservices.operation.client_config), [1]
          • @@ -365,11 +367,11 @@

            D

            E

            @@ -506,7 +516,7 @@

            O

            P

            @@ -514,7 +524,7 @@

            P

            R

              -
            • request_tracking_id() (adobe.pdfservices.operation.exception.exceptions.SdkException property), [1] +
            • request_tracking_id (adobe.pdfservices.operation.exception.exceptions.SdkException property), [1]
            • -
            • shift_headings() (adobe.pdfservices.operation.pdfops.options.autotagpdf.autotag_pdf_options.AutotagPDFOptions property) +
            • shift_headings (adobe.pdfservices.operation.pdfops.options.autotagpdf.autotag_pdf_options.AutotagPDFOptions property)
            • -
            • status_code() (adobe.pdfservices.operation.exception.exceptions.ServiceApiException property), [1] +
            • status_code (adobe.pdfservices.operation.exception.exceptions.ServiceApiException property), [1]
              • (adobe.pdfservices.operation.exception.exceptions.ServiceUsageException property), [1] @@ -576,7 +586,7 @@

                S

                T

                  -
                • table_output_format() (adobe.pdfservices.operation.pdfops.options.extractpdf.extract_pdf_options.ExtractPDFOptions property), [1] +
                • table_output_format (adobe.pdfservices.operation.pdfops.options.extractpdf.extract_pdf_options.ExtractPDFOptions property), [1]
                • TABLES (adobe.pdfservices.operation.pdfops.options.extractpdf.extract_element_type.ExtractElementType attribute) @@ -596,11 +606,11 @@

                  T

                  W

                  - +
                • Exceptions
                • @@ -94,7 +96,7 @@
                  -

                  pdfservices-sdk

                  +

                  pdfservices-sdk

                  This is the documentation of all the exposed classes and modules in the SDK. Please click on any Operation Class in the API Reference section on left nav to get started.

                  diff --git a/docs/build/html/modules.html b/docs/build/html/modules.html index 304b4e2..cf0db3a 100644 --- a/docs/build/html/modules.html +++ b/docs/build/html/modules.html @@ -3,13 +3,15 @@ - src — pdfservices-sdk documentation - + src — pdfservices-sdk documentation + + - + + @@ -62,7 +64,7 @@
                • Exceptions
                • @@ -93,7 +95,7 @@
                  -

                  src

                  +

                  src

                  • adobe package
                      diff --git a/docs/build/html/objects.inv b/docs/build/html/objects.inv index 162008d..e89c045 100644 Binary files a/docs/build/html/objects.inv and b/docs/build/html/objects.inv differ diff --git a/docs/build/html/py-modindex.html b/docs/build/html/py-modindex.html index ff63a43..1cd6bd2 100644 --- a/docs/build/html/py-modindex.html +++ b/docs/build/html/py-modindex.html @@ -3,13 +3,15 @@ - Python Module Index — pdfservices-sdk documentation - + Python Module Index — pdfservices-sdk documentation + + - + + @@ -65,7 +67,7 @@
                  • Exceptions
                  diff --git a/docs/build/html/reference/index.html b/docs/build/html/reference/index.html index c968ea1..059057f 100644 --- a/docs/build/html/reference/index.html +++ b/docs/build/html/reference/index.html @@ -3,13 +3,15 @@ - Overview — pdfservices-sdk documentation - + Overview — pdfservices-sdk documentation + + - + + @@ -63,7 +65,7 @@
                • Exceptions
                • @@ -94,16 +96,16 @@
                  -

                  Overview

                  +

                  Overview

                  -

                  Extract PDF

                  +

                  Extract PDF

                  -

                  ExtractPDFOperation

                  +

                  ExtractPDFOperation

                  -
                  -class adobe.pdfservices.operation.pdfops.extract_pdf_operation.ExtractPDFOperation(create_key)
                  +
                  +class adobe.pdfservices.operation.pdfops.extract_pdf_operation.ExtractPDFOperation(create_key)

                  Bases: adobe.pdfservices.operation.operation.Operation

                  An Operation that extracts pdf elements such as text and tables in a structured format from a PDF, along with renditions for tables and figures.

                  @@ -137,14 +139,14 @@

                  ExtractPDFOperation -
                  -SUPPORTED_SOURCE_MEDIA_TYPES = {adobe.pdfservices.operation.internal.extension_media_type_mapping.ExtensionMediaTypeMapping.PDF.mime_type}
                  +
                  +SUPPORTED_SOURCE_MEDIA_TYPES = {adobe.pdfservices.operation.internal.extension_media_type_mapping.ExtensionMediaTypeMapping.PDF.mime_type}

                  Supported source file formats for ExtractPdfOperation is .pdf.

                  -
                  -classmethod create_new()
                  +
                  +classmethod create_new()

                  creates a new instance of ExtractPDFOperation.

                  Returns
                  @@ -157,8 +159,8 @@

                  ExtractPDFOperation -
                  -execute(execution_context: adobe.pdfservices.operation.execution_context.ExecutionContext)
                  +
                  +execute(execution_context: adobe.pdfservices.operation.execution_context.ExecutionContext)

                  Executes this operation synchronously using the supplied context and returns a new FileRef instance for the resulting Zip file. The resulting file may be stored in the system temporary directory. See adobe.pdfservices.operation.io.file_ref.FileRef for how temporary resources are cleaned up.

                  @@ -178,8 +180,22 @@

                  ExtractPDFOperation -
                  -set_input(source_file_ref: adobe.pdfservices.operation.io.file_ref.FileRef)
                  +
                  +get_options()
                  +

                  gets the ExtractPDFOptions.

                  +
                  +
                  Returns
                  +

                  The options parameter of the operation

                  +
                  +
                  Return type
                  +

                  ExtractPDFOptions

                  +
                  +
                  +

                  + +
                  +
                  +set_input(source_file_ref: adobe.pdfservices.operation.io.file_ref.FileRef)

                  Sets an input file.

                  Parameters
                  @@ -195,8 +211,8 @@

                  ExtractPDFOperation -
                  -set_options(extract_pdf_options: adobe.pdfservices.operation.pdfops.options.extractpdf.extract_pdf_options.ExtractPDFOptions)
                  +
                  +set_options(extract_pdf_options: adobe.pdfservices.operation.pdfops.options.extractpdf.extract_pdf_options.ExtractPDFOptions)

                  sets the ExtractPDFOptions.

                  Parameters
                  @@ -215,10 +231,10 @@

                  ExtractPDFOperation -

                  ExtractPDFOptions

                  +

                  ExtractPDFOptions

                  -
                  -class adobe.pdfservices.operation.pdfops.options.extractpdf.extract_pdf_options.ExtractPDFOptions(elements_to_extract, elements_to_extract_renditions, get_char_info, table_output_format, include_styling_info=None)
                  +
                  +class adobe.pdfservices.operation.pdfops.options.extractpdf.extract_pdf_options.ExtractPDFOptions(elements_to_extract, elements_to_extract_renditions, get_char_info, table_output_format, include_styling_info=None)

                  Bases: object

                  An Options Class that defines the options for ExtractPDFOperation.

                  extract_pdf_options: ExtractPDFOptions = ExtractPDFOptions.builder() \
                  @@ -231,18 +247,18 @@ 

                  ExtractPDFOptions -
                  -class Builder
                  +
                  +class Builder

                  Bases: object

                  The builder for ExtractPDFOptions.

                  -
                  -build()
                  +
                  +build()
                  -
                  -with_element_to_extract(element_to_extract: adobe.pdfservices.operation.pdfops.options.extractpdf.extract_element_type.ExtractElementType)
                  +
                  +with_element_to_extract(element_to_extract: adobe.pdfservices.operation.pdfops.options.extractpdf.extract_element_type.ExtractElementType)

                  adds a pdf element type for extracting structured information.

                  Parameters
                  @@ -261,8 +277,8 @@

                  ExtractPDFOptions -
                  -with_element_to_extract_renditions(element_to_extract_renditions: adobe.pdfservices.operation.pdfops.options.extractpdf.extract_renditions_element_type.ExtractRenditionsElementType)
                  +
                  +with_element_to_extract_renditions(element_to_extract_renditions: adobe.pdfservices.operation.pdfops.options.extractpdf.extract_renditions_element_type.ExtractRenditionsElementType)

                  adds a pdf element type for extracting rendition.

                  Parameters
                  @@ -281,8 +297,8 @@

                  ExtractPDFOptions -
                  -with_elements_to_extract(elements_to_extract: List[adobe.pdfservices.operation.pdfops.options.extractpdf.extract_element_type.ExtractElementType])
                  +
                  +with_elements_to_extract(elements_to_extract: List[adobe.pdfservices.operation.pdfops.options.extractpdf.extract_element_type.ExtractElementType])

                  adds a list of pdf element types for extracting structured information.

                  Parameters
                  @@ -301,8 +317,8 @@

                  ExtractPDFOptions -
                  -with_elements_to_extract_renditions(elements_to_extract_renditions: List[adobe.pdfservices.operation.pdfops.options.extractpdf.extract_renditions_element_type.ExtractRenditionsElementType])
                  +
                  +with_elements_to_extract_renditions(elements_to_extract_renditions: List[adobe.pdfservices.operation.pdfops.options.extractpdf.extract_renditions_element_type.ExtractRenditionsElementType])

                  adds a list of pdf element types for extracting rendition.

                  Parameters
                  @@ -321,8 +337,8 @@

                  ExtractPDFOptions -
                  -with_get_char_info(get_char_info: bool)
                  +
                  +with_get_char_info(get_char_info: bool)

                  sets the Boolean specifying whether to add character level bounding boxes to output json

                  Parameters
                  @@ -338,8 +354,8 @@

                  ExtractPDFOptions -
                  -with_include_styling_info(include_styling_info: bool)
                  +
                  +with_include_styling_info(include_styling_info: bool)

                  sets the Boolean specifying whether to add PDF Elements Styling Info to output json

                  Parameters
                  @@ -355,8 +371,8 @@

                  ExtractPDFOptions -
                  -with_table_structure_format(table_structure: adobe.pdfservices.operation.pdfops.options.extractpdf.table_structure_type.TableStructureType)
                  +
                  +with_table_structure_format(table_structure: adobe.pdfservices.operation.pdfops.options.extractpdf.table_structure_type.TableStructureType)

                  adds the table structure format (currently csv only) for extracting structured information.

                  Parameters
                  @@ -377,8 +393,8 @@

                  ExtractPDFOptions -
                  -static builder()
                  +
                  +static builder()

                  Returns a Builder for ExtractPDFOptions

                  Returns
                  @@ -390,33 +406,33 @@

                  ExtractPDFOptions -
                  -property elements_to_extract
                  +
                  +
                  +property elements_to_extract

                  List of pdf element types to be extracted in a structured format from input file

                  -
                  -
                  -property elements_to_extract_renditions
                  +
                  +
                  +property elements_to_extract_renditions

                  List of pdf element types whose renditions needs to be extracted from input file

                  -
                  -
                  -property get_char_info
                  +
                  +
                  +property get_char_info

                  Boolean specifying whether to add character level bounding boxes to output json

                  -
                  -
                  -property include_styling_info
                  +
                  +
                  +property include_styling_info

                  Boolean specifying whether to add PDF Elements Styling Info to output json

                  -
                  -
                  -property table_output_format
                  +
                  +
                  +property table_output_format

                  export table in specified format - currently csv supported

                  @@ -425,12 +441,12 @@

                  ExtractPDFOptions -

                  Autotag PDF

                  +

                  Autotag PDF

                  -

                  AutotagPDFOperation

                  +

                  AutotagPDFOperation

                  -
                  -class adobe.pdfservices.operation.pdfops.autotag_pdf_operation.AutotagPDFOperation(create_key)
                  +
                  +class adobe.pdfservices.operation.pdfops.autotag_pdf_operation.AutotagPDFOperation(create_key)

                  Bases: adobe.pdfservices.operation.operation.Operation

                  An operation that enables clients to improve accessibility of the PDF document. It generates the tagged PDF, along with an optional XLSX report providing detailed information about the added tags. The operation replaces any @@ -474,14 +490,14 @@

                  AutotagPDFOperation -
                  -SUPPORTED_SOURCE_MEDIA_TYPES = {adobe.pdfservices.operation.internal.extension_media_type_mapping.ExtensionMediaTypeMapping.PDF.mime_type}
                  +
                  +SUPPORTED_SOURCE_MEDIA_TYPES = {adobe.pdfservices.operation.internal.extension_media_type_mapping.ExtensionMediaTypeMapping.PDF.mime_type}

                  Supported source file formats for AutotagPdfOperation is .pdf.

                  -
                  -classmethod create_new()
                  +
                  +classmethod create_new()

                  creates a new instance of AutotagPDFOperation.

                  Returns
                  @@ -494,8 +510,8 @@

                  AutotagPDFOperation -
                  -execute(execution_context: adobe.pdfservices.operation.execution_context.ExecutionContext)
                  +
                  +execute(execution_context: adobe.pdfservices.operation.execution_context.ExecutionContext)

                  Executes this operation synchronously using the supplied context and returns a new AutotagPDFOutputFiles instance for the generated tagged pdf file and XLSX report file. The resulting file may be stored in the system temporary directory. @@ -517,8 +533,22 @@

                  AutotagPDFOperation -
                  -set_input(source_file_ref: adobe.pdfservices.operation.io.file_ref.FileRef)
                  +
                  +get_options()
                  +

                  gets the AutotagPDFOptions.

                  +
                  +
                  Returns
                  +

                  The options parameter of the operation

                  +
                  +
                  Return type
                  +

                  AutotagPDFOptions

                  +
                  +
                  +

                  + +
                  +
                  +set_input(source_file_ref: adobe.pdfservices.operation.io.file_ref.FileRef)

                  Sets an input file.

                  Parameters
                  @@ -534,8 +564,8 @@

                  AutotagPDFOperation -
                  -set_options(autotag_pdf_options: adobe.pdfservices.operation.pdfops.options.autotagpdf.autotag_pdf_options.AutotagPDFOptions)
                  +
                  +set_options(autotag_pdf_options: adobe.pdfservices.operation.pdfops.options.autotagpdf.autotag_pdf_options.AutotagPDFOptions)

                  sets the AutotagPDFOptions.

                  Parameters
                  @@ -554,10 +584,10 @@

                  AutotagPDFOperation -

                  AutotagPDFOptions

                  +

                  AutotagPDFOptions

                  -
                  -class adobe.pdfservices.operation.pdfops.options.autotagpdf.autotag_pdf_options.AutotagPDFOptions(generate_report, shift_headings)
                  +
                  +class adobe.pdfservices.operation.pdfops.options.autotagpdf.autotag_pdf_options.AutotagPDFOptions(generate_report, shift_headings)

                  Bases: object

                  An Options Class that defines the options for AutotagPDFOperation.

                  autotag_pdf_options: AutotagPDFOptions = AutotagPDFOptions.builder() \
                  @@ -567,19 +597,19 @@ 

                  AutotagPDFOptions -
                  -class Builder
                  +
                  +class Builder

                  Bases: object

                  The builder for AutotagPDFOptions.

                  -
                  -build()
                  +
                  +build()

                  builds and returns the AutotagPDFOptions instance

                  -
                  -with_generate_report()
                  +
                  +with_generate_report()

                  sets the Boolean specifying whether to generate an XLSX report containing the information about the tags

                  Returns
                  @@ -592,8 +622,8 @@

                  AutotagPDFOptions -
                  -with_shift_headings()
                  +
                  +with_shift_headings()

                  sets the Boolean specifying whether to shift headings in the output PDF file

                  Returns
                  @@ -608,8 +638,8 @@

                  AutotagPDFOptions -
                  -static builder()
                  +
                  +static builder()

                  Returns a Builder for AutotagPDFOptions

                  Returns
                  @@ -621,15 +651,15 @@

                  AutotagPDFOptions -
                  -property generate_report
                  +
                  +
                  +property generate_report

                  Boolean specifying whether to generate an XLSX report as an output

                  -
                  -
                  -property shift_headings
                  +
                  +
                  +property shift_headings

                  Boolean specifying whether to shift the headings in the output PDF file

                  @@ -638,22 +668,22 @@

                  AutotagPDFOptions -

                  Config

                  +

                  Config

                  -

                  ClientConfig

                  +

                  ClientConfig

                  -
                  -class adobe.pdfservices.operation.client_config.ClientConfig
                  +
                  +class adobe.pdfservices.operation.client_config.ClientConfig

                  Bases: object

                  Encapsulates the API request configurations

                  -
                  -class Builder
                  +
                  +class Builder

                  Bases: object

                  Builds a ClientConfig instance.

                  -
                  -build()
                  +
                  +build()

                  Returns a new ClientConfig instance built from the current state of this builder.

                  Returns
                  @@ -666,8 +696,8 @@

                  ClientConfig -
                  -from_file(client_config_file_path: str)
                  +
                  +from_file(client_config_file_path: str)

                  Sets the connect timeout and read timeout using the JSON client config file path. All the keys in the JSON structure are optional.

                  Parameters
                  @@ -690,8 +720,8 @@

                  ClientConfig -
                  -with_connect_timeout(connect_timeout: int)
                  +
                  +with_connect_timeout(connect_timeout: int)

                  Sets the connect timeout. It should be greater than zero.

                  Parameters
                  @@ -707,8 +737,25 @@

                  ClientConfig -
                  -with_read_timeout(read_timeout: int)
                  +
                  +with_pdf_services_uri(pdf_services_uri: str)
                  +

                  Sets the pdf services uri link.

                  +
                  +
                  Parameters
                  +

                  pdf_services_uri (str) – url for the new rest api

                  +
                  +
                  Returns
                  +

                  This Builder instance to add any additional parameters.

                  +
                  +
                  Return type
                  +

                  ClientConfig.Builder

                  +
                  +
                  +

                  + +
                  +
                  +with_read_timeout(read_timeout: int)

                  Sets the read timeout. It should be greater than zero.

                  Parameters
                  @@ -726,8 +773,8 @@

                  ClientConfig -
                  -static builder()
                  +
                  +static builder()

                  Creates a new ClientConfig builder.

                  Returns
                  @@ -743,15 +790,15 @@

                  ClientConfig -

                  ClientConfigBuilder

                  +

                  ClientConfigBuilder

                  -
                  -class adobe.pdfservices.operation.client_config.ClientConfig.Builder
                  +
                  +class adobe.pdfservices.operation.client_config.ClientConfig.Builder

                  Bases: object

                  Builds a ClientConfig instance.

                  -
                  -build()
                  +
                  +build()

                  Returns a new ClientConfig instance built from the current state of this builder.

                  Returns
                  @@ -764,8 +811,8 @@

                  ClientConfigBuilder -
                  -from_file(client_config_file_path: str)
                  +
                  +from_file(client_config_file_path: str)

                  Sets the connect timeout and read timeout using the JSON client config file path. All the keys in the JSON structure are optional.

                  Parameters
                  @@ -788,8 +835,8 @@

                  ClientConfigBuilder -
                  -with_connect_timeout(connect_timeout: int)
                  +
                  +with_connect_timeout(connect_timeout: int)

                  Sets the connect timeout. It should be greater than zero.

                  Parameters
                  @@ -805,8 +852,25 @@

                  ClientConfigBuilder -
                  -with_read_timeout(read_timeout: int)
                  +
                  +with_pdf_services_uri(pdf_services_uri: str)
                  +

                  Sets the pdf services uri link.

                  +
                  +
                  Parameters
                  +

                  pdf_services_uri (str) – url for the new rest api

                  +
                  +
                  Returns
                  +

                  This Builder instance to add any additional parameters.

                  +
                  +
                  Return type
                  +

                  ClientConfig.Builder

                  +
                  +
                  +

                  + +
                  +
                  +with_read_timeout(read_timeout: int)

                  Sets the read timeout. It should be greater than zero.

                  Parameters
                  @@ -825,10 +889,10 @@

                  ClientConfigBuilder -

                  ExecutionContext

                  +

                  ExecutionContext

                  -
                  -class adobe.pdfservices.operation.execution_context.ExecutionContext
                  +
                  +class adobe.pdfservices.operation.execution_context.ExecutionContext

                  Bases: object

                  Represents the execution context of an Operation. An execution context typically consists of the desired authentication credentials and client configurations such as timeouts.

                  @@ -862,8 +926,8 @@

                  ExecutionContext -
                  -static create(credentials: adobe.pdfservices.operation.auth.credentials.Credentials, client_config: Optional[adobe.pdfservices.operation.client_config.ClientConfig] = None)
                  +
                  +static create(credentials: adobe.pdfservices.operation.auth.credentials.Credentials, client_config: Optional[adobe.pdfservices.operation.client_config.ClientConfig] = None)

                  Creates a context instance using the provided Credentials and ClientConfig

                  Parameters
                  @@ -886,25 +950,25 @@

                  ExecutionContext -

                  Auth

                  +

                  Auth

                  -

                  Credentials

                  +

                  Credentials

                  -
                  -class adobe.pdfservices.operation.auth.credentials.Credentials
                  +
                  +class adobe.pdfservices.operation.auth.credentials.Credentials

                  Bases: abc.ABC

                  Marker base class for different types of credentials. Currently it supports only ServiceAccountCredentials. The factory methods within this class can be used to create instances of credentials classes.

                  -
                  -static service_account_credentials_builder()
                  +
                  +static service_account_credentials_builder()

                  Creates a new ServiceAccountCredentials builder.

                  Returns

                  An instance of ServiceAccountCredentials Builder.

                  Return type
                  -

                  ServiceAccountCredentials.Builder

                  +

                  ServiceAccountCredentials.Builder

                  @@ -913,22 +977,22 @@

                  Credentials -

                  ServiceAccountCredentials

                  +

                  ServiceAccountCredentials

                  -
                  -class adobe.pdfservices.operation.auth.service_account_credentials.ServiceAccountCredentials(client_id, client_secret, private_key, organization_id, account_id, ims_base_uri=adobe.pdfservices.operation.internal.service_constants.ServiceConstants.JWT_BASE_URI, claim=None)
                  +
                  +class adobe.pdfservices.operation.auth.service_account_credentials.ServiceAccountCredentials(client_id, client_secret, private_key, organization_id, account_id, ims_base_uri=adobe.pdfservices.operation.internal.constants.service_constants.ServiceConstants.JWT_BASE_URI, claim=None)

                  Bases: adobe.pdfservices.operation.auth.credentials.Credentials, abc.ABC

                  Service Account credentials allow your application to call PDF Tools Extract API on behalf of the application itself, or on behalf of an enterprise organization. For getting the credentials, Click Here.

                  -
                  -class Builder
                  +
                  +class Builder

                  Bases: object

                  Builds a ServiceAccountCredentials instance.

                  -
                  -build()
                  +
                  +build()

                  Returns a new ServiceAccountCredentials instance built from the current state of this builder.

                  Returns
                  @@ -941,8 +1005,8 @@

                  ServiceAccountCredentials -
                  -from_file(credentials_file_path: str)
                  +
                  +from_file(credentials_file_path: str)

                  Sets Service Account Credentials using the JSON credentials file path. All the keys in the JSON structure are optional.

                  JSON structure:

                  {
                  @@ -967,14 +1031,14 @@ 

                  ServiceAccountCredentials

                  This Builder instance to add any additional parameters.

                  Return type
                  -

                  ServiceAccountCredentials.Builder

                  +

                  ServiceAccountCredentials.Builder

                  -
                  -with_account_id(account_id: str)
                  +
                  +with_account_id(account_id: str)

                  Set Account Id (format: id@techacct.adobe.com)

                  Parameters
                  @@ -984,14 +1048,14 @@

                  ServiceAccountCredentials

                  This Builder instance to add any additional parameters.

                  Return type
                  -

                  ServiceAccountCredentials.Builder

                  +

                  ServiceAccountCredentials.Builder

                  -
                  -with_client_id(client_id: str)
                  +
                  +with_client_id(client_id: str)

                  Set Client ID (API Key)

                  Parameters
                  @@ -1001,14 +1065,14 @@

                  ServiceAccountCredentials

                  This Builder instance to add any additional parameters.

                  Return type
                  -

                  ServiceAccountCredentials.Builder

                  +

                  ServiceAccountCredentials.Builder

                  -
                  -with_client_secret(client_secret: str)
                  +
                  +with_client_secret(client_secret: str)

                  Set Client Secret

                  Parameters
                  @@ -1018,14 +1082,14 @@

                  ServiceAccountCredentials

                  This Builder instance to add any additional parameters.

                  Return type
                  -

                  ServiceAccountCredentials.Builder

                  +

                  ServiceAccountCredentials.Builder

                  -
                  -with_organization_id(organization_id: str)
                  +
                  +with_organization_id(organization_id: str)

                  Set Organization Id (format: org_ident@AdobeOrg) that has been configured for access to PDF Tools API

                  Parameters
                  @@ -1035,14 +1099,14 @@

                  ServiceAccountCredentials

                  This Builder instance to add any additional parameters.

                  Return type
                  -

                  ServiceAccountCredentials.Builder

                  +

                  ServiceAccountCredentials.Builder

                  -
                  -with_private_key(private_key: str)
                  +
                  +with_private_key(private_key: str)

                  Set private key

                  Parameters
                  @@ -1052,46 +1116,46 @@

                  ServiceAccountCredentials

                  This Builder instance to add any additional parameters.

                  Return type
                  -

                  ServiceAccountCredentials.Builder

                  +

                  ServiceAccountCredentials.Builder

                  -
                  -
                  -property account_id
                  +
                  +
                  +property account_id

                  Account ID(format: id@techacct.adobe.com)

                  -
                  -
                  -property claim
                  +
                  +
                  +property claim

                  Identifies the Service for which Authorization(Access) Token will be issued

                  -
                  -
                  -property client_id
                  +
                  +
                  +property client_id

                  Client Id (API Key)

                  -
                  -
                  -property client_secret
                  +
                  +
                  +property client_secret

                  Client Secret

                  -
                  -
                  -property organization_id
                  +
                  +
                  +property organization_id

                  Identifies the organization(format: org_ident@AdobeOrg) that has been configured for access to PDF Tools API.

                  -
                  -
                  -property private_key
                  +
                  +
                  +property private_key

                  Content of the Private Key (PEM format)

                  @@ -1099,15 +1163,15 @@

                  ServiceAccountCredentials -

                  ServiceAccountCredentialsBuilder

                  +

                  ServiceAccountCredentialsBuilder

                  -
                  -class adobe.pdfservices.operation.auth.service_account_credentials.ServiceAccountCredentials.Builder
                  +
                  +class adobe.pdfservices.operation.auth.service_account_credentials.ServiceAccountCredentials.Builder

                  Bases: object

                  Builds a ServiceAccountCredentials instance.

                  -
                  -build()
                  +
                  +build()

                  Returns a new ServiceAccountCredentials instance built from the current state of this builder.

                  Returns
                  @@ -1120,8 +1184,8 @@

                  ServiceAccountCredentialsBuilder -
                  -from_file(credentials_file_path: str)
                  +
                  +from_file(credentials_file_path: str)

                  Sets Service Account Credentials using the JSON credentials file path. All the keys in the JSON structure are optional.

                  JSON structure:

                  {
                  @@ -1146,14 +1210,14 @@ 

                  ServiceAccountCredentialsBuilder

                  This Builder instance to add any additional parameters.

                  Return type
                  -

                  ServiceAccountCredentials.Builder

                  +

                  ServiceAccountCredentials.Builder

                  -
                  -with_account_id(account_id: str)
                  +
                  +with_account_id(account_id: str)

                  Set Account Id (format: id@techacct.adobe.com)

                  Parameters
                  @@ -1163,14 +1227,14 @@

                  ServiceAccountCredentialsBuilder

                  This Builder instance to add any additional parameters.

                  Return type
                  -

                  ServiceAccountCredentials.Builder

                  +

                  ServiceAccountCredentials.Builder

                  -
                  -with_client_id(client_id: str)
                  +
                  +with_client_id(client_id: str)

                  Set Client ID (API Key)

                  Parameters
                  @@ -1180,14 +1244,14 @@

                  ServiceAccountCredentialsBuilder

                  This Builder instance to add any additional parameters.

                  Return type
                  -

                  ServiceAccountCredentials.Builder

                  +

                  ServiceAccountCredentials.Builder

                  -
                  -with_client_secret(client_secret: str)
                  +
                  +with_client_secret(client_secret: str)

                  Set Client Secret

                  Parameters
                  @@ -1197,14 +1261,14 @@

                  ServiceAccountCredentialsBuilder

                  This Builder instance to add any additional parameters.

                  Return type
                  -

                  ServiceAccountCredentials.Builder

                  +

                  ServiceAccountCredentials.Builder

                  -
                  -with_organization_id(organization_id: str)
                  +
                  +with_organization_id(organization_id: str)

                  Set Organization Id (format: org_ident@AdobeOrg) that has been configured for access to PDF Tools API

                  Parameters
                  @@ -1214,14 +1278,14 @@

                  ServiceAccountCredentialsBuilder

                  This Builder instance to add any additional parameters.

                  Return type
                  -

                  ServiceAccountCredentials.Builder

                  +

                  ServiceAccountCredentials.Builder

                  -
                  -with_private_key(private_key: str)
                  +
                  +with_private_key(private_key: str)

                  Set private key

                  Parameters
                  @@ -1231,7 +1295,7 @@

                  ServiceAccountCredentialsBuilder

                  This Builder instance to add any additional parameters.

                  Return type
                  -

                  ServiceAccountCredentials.Builder

                  +

                  ServiceAccountCredentials.Builder

                  @@ -1241,19 +1305,19 @@

                  ServiceAccountCredentialsBuilder -

                  IO

                  +

                  IO

                  -

                  FileRef

                  +

                  FileRef

                  -
                  -class adobe.pdfservices.operation.io.file_ref.FileRef
                  +
                  +class adobe.pdfservices.operation.io.file_ref.FileRef

                  Bases: abc.ABC

                  This class represents a local file. It is typically used by an SDK Operation which accepts or returns files.

                  When a FileRef instance is created by this SDK while referring to a temporary file location, calling any of the methods to save the fileRef (For example, create_from_stream() etc.) will delete the temporary file.

                  -
                  -static create_from_local_file(local_source: str, media_type: Optional[str] = None)
                  +
                  +static create_from_local_file(local_source: str, media_type: Optional[str] = None)

                  Creates a FileRef instance from a local file path. If no media type is provided, it will be inferred from the file extension.

                  @@ -1273,8 +1337,8 @@

                  FileRef -
                  -static create_from_stream(input_stream: _io.BufferedReader, media_type: str)
                  +
                  +static create_from_stream(input_stream: _io.BufferedReader, media_type: str)

                  Creates a FileRef instance from a readable stream using the specified media type. The stream is not read by this method but by consumers of file content i.e. the execute method of an operation such as execute().

                  @@ -1295,13 +1359,19 @@

                  FileRef -
                  -abstract save_as(local_file_path: str)
                  +
                  +get_media_type()
                  +

                  returns the media type

                  +

                  + +
                  +
                  +abstract save_as(local_file_path: str)
                  -
                  -abstract write_to_stream(writer_stream)
                  +
                  +abstract write_to_stream(writer_stream)
                  @@ -1309,91 +1379,91 @@

                  FileRef -

                  Exceptions

                  -
                  -

                  Exceptions

                  +

                  Exceptions

                  +
                  +

                  Exceptions

                  -
                  -exception adobe.pdfservices.operation.exception.exceptions.SdkException(message, request_tracking_id=None)
                  +
                  +exception adobe.pdfservices.operation.exception.exceptions.SdkException(message, request_tracking_id=None)

                  Bases: Exception

                  SdkException is typically thrown for client-side or network errors.

                  -
                  -
                  -property request_tracking_id
                  +
                  +
                  +property request_tracking_id

                  The request tracking id of the exception.

                  -
                  -exception adobe.pdfservices.operation.exception.exceptions.ServiceApiException(message, request_tracking_id, status_code=0, error_code='UNKNOWN')
                  +
                  +exception adobe.pdfservices.operation.exception.exceptions.ServiceApiException(message, request_tracking_id, status_code=0, error_code='UNKNOWN')

                  Bases: Exception

                  ServiceApiException is thrown when an underlying service API call results in an error.

                  -
                  -DEFAULT_ERROR_CODE = 'UNKNOWN'
                  +
                  +DEFAULT_ERROR_CODE = 'UNKNOWN'

                  Returns the HTTP Status code or DEFAULT_STATUS_CODE if the status code doesn’t adequately represent the error.

                  -
                  -DEFAULT_STATUS_CODE = 0
                  +
                  +DEFAULT_STATUS_CODE = 0

                  The default value of status code if there is no status code for this service exception.

                  -
                  -
                  -property error_code
                  +
                  +
                  +property error_code

                  Returns the detailed message of this error.

                  -
                  -
                  -property request_tracking_id
                  +
                  +
                  +property request_tracking_id

                  The request tracking id of the exception.

                  -
                  -
                  -property status_code
                  +
                  +
                  +property status_code

                  Returns the HTTP Status code or DEFAULT_STATUS_CODE if the status code doesn’t adequately represent the error.

                  -
                  -exception adobe.pdfservices.operation.exception.exceptions.ServiceUsageException(message, request_tracking_id, status_code=429, error_code='UNKNOWN')
                  +
                  +exception adobe.pdfservices.operation.exception.exceptions.ServiceUsageException(message, request_tracking_id, status_code=429, error_code='UNKNOWN')

                  Bases: Exception

                  ServiceUsageError is thrown when either service usage limit has been reached or credentials quota has been exhausted.

                  -
                  -DEFAULT_ERROR_CODE = 'UNKNOWN'
                  +
                  +DEFAULT_ERROR_CODE = 'UNKNOWN'

                  The default value of error code if there is no status code for this service failure.

                  -
                  -DEFAULT_STATUS_CODE = 429
                  +
                  +DEFAULT_STATUS_CODE = 429

                  The default value of status code if there is no status code for this service failure.

                  -
                  -
                  -property error_code
                  +
                  +
                  +property error_code

                  Returns the detailed message of this error.

                  -
                  -
                  -property request_tracking_id
                  +
                  +
                  +property request_tracking_id

                  The request tracking id of the exception.

                  -
                  -
                  -property status_code
                  +
                  +
                  +property status_code

                  Returns the HTTP Status code or DEFAULT_STATUS_CODE if the status code doesn’t adequately represent the error.

                  diff --git a/docs/build/html/search.html b/docs/build/html/search.html index 16f67a1..74ea967 100644 --- a/docs/build/html/search.html +++ b/docs/build/html/search.html @@ -3,14 +3,16 @@ - Search — pdfservices-sdk documentation - + Search — pdfservices-sdk documentation + + - + + @@ -65,7 +67,7 @@
                • Exceptions
                • diff --git a/docs/build/html/searchindex.js b/docs/build/html/searchindex.js index f07caf5..46af227 100644 --- a/docs/build/html/searchindex.js +++ b/docs/build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["adobe","adobe.pdfservices","adobe.pdfservices.operation","adobe.pdfservices.operation.auth","adobe.pdfservices.operation.exception","adobe.pdfservices.operation.io","adobe.pdfservices.operation.pdfops","adobe.pdfservices.operation.pdfops.options","adobe.pdfservices.operation.pdfops.options.extractpdf","index","modules","reference/index"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":1,sphinx:56},filenames:["adobe.rst","adobe.pdfservices.rst","adobe.pdfservices.operation.rst","adobe.pdfservices.operation.auth.rst","adobe.pdfservices.operation.exception.rst","adobe.pdfservices.operation.io.rst","adobe.pdfservices.operation.pdfops.rst","adobe.pdfservices.operation.pdfops.options.rst","adobe.pdfservices.operation.pdfops.options.extractpdf.rst","index.rst","modules.rst","reference/index.rst"],objects:{"":{adobe:[0,0,0,"-"]},"adobe.pdfservices":{operation:[2,0,0,"-"]},"adobe.pdfservices.operation":{auth:[3,0,0,"-"],client_config:[2,0,0,"-"],exception:[4,0,0,"-"],execution_context:[2,0,0,"-"],io:[5,0,0,"-"],operation:[2,0,0,"-"],pdfops:[6,0,0,"-"]},"adobe.pdfservices.operation.auth":{credentials:[3,0,0,"-"],service_account_credentials:[3,0,0,"-"]},"adobe.pdfservices.operation.auth.credentials":{Credentials:[11,1,1,""]},"adobe.pdfservices.operation.auth.credentials.Credentials":{service_account_credentials_builder:[11,2,1,""]},"adobe.pdfservices.operation.auth.service_account_credentials":{ServiceAccountCredentials:[11,1,1,""]},"adobe.pdfservices.operation.auth.service_account_credentials.ServiceAccountCredentials":{Builder:[11,1,1,"id5"],account_id:[11,2,1,""],claim:[11,2,1,""],client_id:[11,2,1,""],client_secret:[11,2,1,""],organization_id:[11,2,1,""],private_key:[11,2,1,""]},"adobe.pdfservices.operation.auth.service_account_credentials.ServiceAccountCredentials.Builder":{build:[11,2,1,"id6"],from_file:[11,2,1,"id7"],with_account_id:[11,2,1,"id8"],with_client_id:[11,2,1,"id9"],with_client_secret:[11,2,1,"id10"],with_organization_id:[11,2,1,"id11"],with_private_key:[11,2,1,"id12"]},"adobe.pdfservices.operation.client_config":{ClientConfig:[11,1,1,""]},"adobe.pdfservices.operation.client_config.ClientConfig":{Builder:[11,1,1,"id0"],builder:[11,2,1,""]},"adobe.pdfservices.operation.client_config.ClientConfig.Builder":{build:[11,2,1,"id1"],from_file:[11,2,1,"id2"],with_connect_timeout:[11,2,1,"id3"],with_read_timeout:[11,2,1,"id4"]},"adobe.pdfservices.operation.exception":{exceptions:[11,0,0,"-"]},"adobe.pdfservices.operation.exception.exceptions":{SdkException:[11,3,1,""],ServiceApiException:[11,3,1,""],ServiceUsageException:[11,3,1,""]},"adobe.pdfservices.operation.exception.exceptions.SdkException":{request_tracking_id:[11,2,1,""]},"adobe.pdfservices.operation.exception.exceptions.ServiceApiException":{DEFAULT_ERROR_CODE:[11,4,1,""],DEFAULT_STATUS_CODE:[11,4,1,""],error_code:[11,2,1,""],request_tracking_id:[11,2,1,""],status_code:[11,2,1,""]},"adobe.pdfservices.operation.exception.exceptions.ServiceUsageException":{DEFAULT_ERROR_CODE:[11,4,1,""],DEFAULT_STATUS_CODE:[11,4,1,""],error_code:[11,2,1,""],request_tracking_id:[11,2,1,""],status_code:[11,2,1,""]},"adobe.pdfservices.operation.execution_context":{ExecutionContext:[11,1,1,""]},"adobe.pdfservices.operation.execution_context.ExecutionContext":{create:[11,2,1,""]},"adobe.pdfservices.operation.io":{file_ref:[5,0,0,"-"]},"adobe.pdfservices.operation.io.file_ref":{FileRef:[11,1,1,""]},"adobe.pdfservices.operation.io.file_ref.FileRef":{create_from_local_file:[11,2,1,""],create_from_stream:[11,2,1,""],save_as:[11,2,1,""],write_to_stream:[11,2,1,""]},"adobe.pdfservices.operation.operation":{Operation:[2,1,1,""]},"adobe.pdfservices.operation.operation.Operation":{execute:[2,2,1,""]},"adobe.pdfservices.operation.pdfops":{extract_pdf_operation:[6,0,0,"-"],options:[7,0,0,"-"]},"adobe.pdfservices.operation.pdfops.autotag_pdf_operation":{AutotagPDFOperation:[11,1,1,""]},"adobe.pdfservices.operation.pdfops.autotag_pdf_operation.AutotagPDFOperation":{SUPPORTED_SOURCE_MEDIA_TYPES:[11,4,1,""],create_new:[11,2,1,""],execute:[11,2,1,""],set_input:[11,2,1,""],set_options:[11,2,1,""]},"adobe.pdfservices.operation.pdfops.extract_pdf_operation":{ExtractPDFOperation:[11,1,1,""]},"adobe.pdfservices.operation.pdfops.extract_pdf_operation.ExtractPDFOperation":{SUPPORTED_SOURCE_MEDIA_TYPES:[11,4,1,""],create_new:[11,2,1,""],execute:[11,2,1,""],set_input:[11,2,1,""],set_options:[11,2,1,""]},"adobe.pdfservices.operation.pdfops.options":{extractpdf:[8,0,0,"-"]},"adobe.pdfservices.operation.pdfops.options.autotagpdf.autotag_pdf_options":{AutotagPDFOptions:[11,1,1,""]},"adobe.pdfservices.operation.pdfops.options.autotagpdf.autotag_pdf_options.AutotagPDFOptions":{Builder:[11,1,1,""],builder:[11,2,1,""],generate_report:[11,2,1,""],shift_headings:[11,2,1,""]},"adobe.pdfservices.operation.pdfops.options.autotagpdf.autotag_pdf_options.AutotagPDFOptions.Builder":{build:[11,2,1,""],with_generate_report:[11,2,1,""],with_shift_headings:[11,2,1,""]},"adobe.pdfservices.operation.pdfops.options.extractpdf":{extract_element_type:[8,0,0,"-"],extract_pdf_options:[8,0,0,"-"],extract_renditions_element_type:[8,0,0,"-"],table_structure_type:[8,0,0,"-"]},"adobe.pdfservices.operation.pdfops.options.extractpdf.extract_element_type":{ExtractElementType:[8,1,1,""]},"adobe.pdfservices.operation.pdfops.options.extractpdf.extract_element_type.ExtractElementType":{TABLES:[8,4,1,""],TEXT:[8,4,1,""]},"adobe.pdfservices.operation.pdfops.options.extractpdf.extract_pdf_options":{ExtractPDFOptions:[11,1,1,""]},"adobe.pdfservices.operation.pdfops.options.extractpdf.extract_pdf_options.ExtractPDFOptions":{Builder:[11,1,1,""],builder:[11,2,1,""],elements_to_extract:[11,2,1,""],elements_to_extract_renditions:[11,2,1,""],get_char_info:[11,2,1,""],include_styling_info:[11,2,1,""],table_output_format:[11,2,1,""]},"adobe.pdfservices.operation.pdfops.options.extractpdf.extract_pdf_options.ExtractPDFOptions.Builder":{build:[11,2,1,""],with_element_to_extract:[11,2,1,""],with_element_to_extract_renditions:[11,2,1,""],with_elements_to_extract:[11,2,1,""],with_elements_to_extract_renditions:[11,2,1,""],with_get_char_info:[11,2,1,""],with_include_styling_info:[11,2,1,""],with_table_structure_format:[11,2,1,""]},"adobe.pdfservices.operation.pdfops.options.extractpdf.extract_renditions_element_type":{ExtractRenditionsElementType:[8,1,1,""]},"adobe.pdfservices.operation.pdfops.options.extractpdf.extract_renditions_element_type.ExtractRenditionsElementType":{FIGURES:[8,4,1,""],TABLES:[8,4,1,""]},"adobe.pdfservices.operation.pdfops.options.extractpdf.table_structure_type":{TableStructureType:[8,1,1,""]},"adobe.pdfservices.operation.pdfops.options.extractpdf.table_structure_type.TableStructureType":{CSV:[8,4,1,""]},adobe:{pdfservices:[1,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"],"3":["py","exception","Python exception"],"4":["py","attribute","Python attribute"]},objtypes:{"0":"py:module","1":"py:class","2":"py:method","3":"py:exception","4":"py:attribute"},terms:{"10000":[2,11],"20000":[2,11],"4000":[2,11],"429":[4,11],"abstract":[2,5,11],"boolean":[8,11],"class":[2,3,5,6,8,9,11],"default":[2,4,5,11],"enum":8,"export":[8,11],"int":[2,11],"new":[2,3,6,11],"return":[2,3,4,5,6,8,11],"static":[2,3,5,8,11],"true":[2,6,8,11],"try":[2,6,11],"while":[2,5,6,11],For:[2,3,5,11],The:[2,3,4,5,6,8,11],__file__:[2,6,11],_io:[5,11],abc:[2,3,5,11],about:11,absolut:[5,11],abspath:[2,6,11],accept:[5,11],access:[3,11],account:[3,11],account_id:[3,11],across:[2,11],add:[2,3,6,8,11],added:11,addit:[2,3,6,8,11],adequ:[4,11],adob:[10,11],adobeorg:[3,11],after:[2,11],all:[2,3,9,11],allow:[3,11],along:[6,11],ani:[2,3,5,6,8,9,11],api:[2,3,4,6,9,11],applic:[3,11],auth:[1,2],authent:[2,11],author:[3,11],autotag_output_fil:11,autotag_pdf_oper:11,autotag_pdf_opt:11,autotagpdf:11,autotagpdfinput:11,autotagpdfoutputfil:11,autotagpdfwithopt:11,base:[2,3,4,5,6,8,11],base_output_path:11,base_path:[2,6,11],been:[3,4,11],behalf:[3,11],benefit:11,bool:[8,11],bound:[8,11],box:[8,11],bufferedread:[5,11],build:[2,3,6,8,11],builder:[2,3,6,8,11],built:[2,3,11],call:[2,3,4,5,6,11],can:[2,3,8,11],charact:[8,11],claim:[3,11],classmethod:[6,11],classpath:[3,11],clean:[6,11],click:[3,9,11],client:[2,3,4,11],client_config:[0,1,11],client_config_file_path:[2,11],client_credenti:[3,11],client_id:[3,11],client_secret:[3,11],clientconfig:2,code:[4,11],com:[3,11],config:2,configur:[2,3,11],connect:[2,11],connect_timeout:[2,11],connecttimeout:[2,11],consist:[2,11],consum:[5,11],contain:11,content:[10,11],context:[2,6,11],creat:[2,3,5,6,11],create_from_local_fil:[2,5,6,11],create_from_stream:[5,11],create_kei:[6,11],create_new:[2,6,11],credenti:[1,2,4,6],credentials_file_path:[3,11],csv:[8,11],current:[2,3,8,11],custom:[2,11],default_error_cod:[4,11],default_status_cod:[4,11],defin:[2,8,11],delet:[5,11],desir:[2,11],detail:[4,11],determin:[2,11],differ:[3,11],directori:[3,5,6,11],dirnam:[2,6,11],document:[9,11],doesn:[4,11],each:[2,11],either:[4,5,11],element:[6,8,11],element_to_extract:[8,11],element_to_extract_rendit:[8,11],elements_to_extract:[8,11],elements_to_extract_rendit:[8,11],elementtyp:8,empti:[8,11],enabl:11,encapsul:[2,11],encount:[2,6,11],enterpris:[3,11],error:[4,6,11],error_cod:[4,11],establish:[2,11],etc:[5,11],exampl:[5,11],except:[1,2,6],execut:[2,5,6,11],execution_context:[0,1,6,11],executioncontext:[2,6],exhaust:[4,11],exist:11,exist_ok:11,expos:9,extens:[5,11],extension_media_type_map:[6,11],extensionmediatypemap:[6,11],extract:[3,6,8],extract_element_typ:[6,7,11],extract_pdf_oper:[1,2,11],extract_pdf_opt:[2,6,7,11],extract_renditions_element_typ:[6,7,11],extractelementtyp:[2,6,8,11],extractpdf:[6,7,11],extractpdfinput:[2,6,11],extractpdfoper:[2,6,8],extractpdfopt:[2,6,8],extractrenditionselementtyp:[2,6,8,11],extracttexttablewithfiguretablerendit:[2,6,11],factori:[3,11],failur:[4,11],figur:[2,6,8,11],file:[2,3,5,6,8,11],file_ref:[1,2,6,11],fileref:[2,5,6],format:[3,5,6,8,11],from:[2,3,5,6,8,11],from_fil:[2,3,6,11],gener:11,generate_report:11,get:[3,9,11],get_char_info:[8,11],greater:[2,11],has:[3,4,11],have:[8,11],head:11,here:[3,11],how:[6,11],http:[2,4,11],identifi:[3,5,11],improv:11,ims_base_uri:[3,11],include_styling_info:[8,11],infer:[5,11],info:[8,11],inform:[8,11],input:[6,8,11],input_file_nam:11,input_file_path:11,input_stream:[5,11],instanc:[2,3,5,6,8,11],intern:[3,6,11],issu:[3,11],itself:[3,11],json:[2,3,6,8,11],jwt_base_uri:[3,11],kei:[2,3,11],left:9,level:[8,11],limit:[4,11],list:[8,11],local:[5,11],local_file_path:[5,11],local_sourc:[5,11],locat:[5,11],log:[2,6,11],look:[3,11],low:11,mai:[6,11],marker:[3,11],media:[5,11],media_typ:[5,11],messag:[4,11],method:[3,5,11],millisecond:[2,11],mime_typ:[6,11],mkdir:11,modul:[9,10],most:11,nav:9,need:[8,11],network:[4,11],none:[2,3,4,5,8,11],number:[2,11],object:[2,3,8,11],onli:[3,8,11],oper:[0,1,9,11],option:[2,3,5,6,11],org_id:[3,11],organ:[3,11],organization_id:[3,11],output:[2,6,8,11],packag:10,paramet:[2,3,5,6,8,11],parent:11,path:[2,3,5,6,11],pdf:[2,3,6,8],pdf_version:[],pdfop:[1,2,11],pdfservic:[0,10,11],pdfversion:[],pem:[3,11],pleas:9,privat:[3,11],private_kei:[3,11],private_key_fil:[3,11],properti:[3,4,8,11],provid:[2,5,11],qualiti:11,quota:[4,11],rais:[6,8,11],reach:[4,11],read:[2,5,11],read_timeout:[2,11],readabl:[5,11],readtimeout:[2,11],refer:[5,9,11],rel:[5,11],rendit:[6,8,11],replac:11,report:11,report_path:11,repres:[2,4,5,11],request:[2,4,11],request_tracking_id:[4,11],resourc:[2,6,11],respons:[2,6,11],result:[2,4,6,11],reus:[2,11],sampl:[2,6,11],save:[5,11],save_a:[2,5,6,11],save_pdf_fil:11,save_xls_fil:11,sdk:[5,11],sdkexcept:[2,4,6,11],secret:[3,11],section:9,see:[6,11],send:[2,11],server:[2,11],servic:[3,4,11],service_account_credenti:[1,2,11],service_account_credentials_build:[2,3,6,11],service_const:[3,11],serviceaccountcredenti:3,serviceapiexcept:[2,4,6,11],serviceconst:[3,11],serviceusageerror:[4,11],serviceusageexcept:[2,4,6,11],set:[2,3,6,8,11],set_input:[2,6,11],set_opt:[2,6,11],shift:11,shift_head:11,should:[2,11],side:[4,11],sourc:[2,6,11],source_file_ref:[6,11],specifi:[5,8,11],start:9,state:[2,3,11],statu:[4,11],status_cod:[4,11],stem:11,store:[6,11],str:[2,3,5,8,11],stream:[5,11],structur:[2,3,6,8,11],style:[8,11],submodul:[0,1,7],subpackag:10,suppli:[6,11],support:[3,6,8,11],supported_source_media_typ:[6,11],synchron:[6,11],system:[6,11],tabl:[2,6,8,11],table_output_format:[8,11],table_structur:[8,11],table_structure_typ:[6,7,11],tablestructuretyp:[8,11],tag:11,tagged_pdf_path:11,techacct:[3,11],temporari:[5,6,11],text:[2,6,8,11],than:[2,11],thi:[2,3,4,5,6,8,9,11],thrown:[4,11],timeout:[2,11],token:[3,11],tool:[3,11],track:[4,11],type:[2,3,5,6,8,11],typic:[2,4,5,11],underli:[4,11],unknown:[4,11],until:[2,11],usag:[2,4,6,11],used:[3,5,11],using:[2,3,5,6,11],v17:[],v20:[],valu:[2,4,8,11],valueerror:[8,11],version:[],wait:[2,11],when:[4,5,11],whether:[8,11],which:[3,5,6,8,11],whose:[8,11],with_account_id:[3,11],with_client_id:[3,11],with_client_secret:[3,11],with_connect_timeout:[2,11],with_element_to_extract:[8,11],with_element_to_extract_rendit:[8,11],with_elements_to_extract:[2,6,8,11],with_elements_to_extract_rendit:[2,6,8,11],with_generate_report:11,with_get_char_info:[2,6,8,11],with_include_styling_info:[6,8,11],with_organization_id:[3,11],with_pdf_vers:[],with_private_kei:[3,11],with_read_timeout:[2,11],with_shift_head:11,with_table_structure_format:[8,11],within:[3,11],work:[5,11],write_to_stream:[5,11],writer_stream:[5,11],xlsx:11,your:[3,11],zero:[2,11],zip:[2,6,11]},titles:["adobe package","adobe.pdfservices package","adobe.pdfservices.operation package","adobe.pdfservices.operation.auth package","adobe.pdfservices.operation.exception package","adobe.pdfservices.operation.io package","adobe.pdfservices.operation.pdfops package","adobe.pdfservices.operation.pdfops.options package","adobe.pdfservices.operation.pdfops.options.extractpdf package","pdfservices-sdk","src","Overview"],titleterms:{adob:[0,1,2,3,4,5,6,7,8],auth:[3,11],autotag:11,autotagpdfoper:11,autotagpdfopt:11,client_config:2,clientconfig:11,clientconfigbuild:11,config:11,content:[0,1,2,3,4,5,6,7,8],credenti:[3,11],except:[4,11],execution_context:2,executioncontext:11,extract:11,extract_element_typ:8,extract_pdf_oper:6,extract_pdf_opt:8,extract_renditions_element_typ:8,extractpdf:8,extractpdfoper:11,extractpdfopt:11,file_ref:5,fileref:11,modul:[0,1,2,3,4,5,6,7,8],oper:[2,3,4,5,6,7,8],option:[7,8],overview:11,packag:[0,1,2,3,4,5,6,7,8],pdf:11,pdfop:[6,7,8],pdfservic:[1,2,3,4,5,6,7,8,9],sdk:9,service_account_credenti:3,serviceaccountcredenti:11,serviceaccountcredentialsbuild:11,src:10,submodul:[2,3,4,5,6,8],subpackag:[0,1,2,6,7],table_structure_typ:8}}) \ No newline at end of file +Search.setIndex({docnames:["adobe","adobe.pdfservices","adobe.pdfservices.operation","adobe.pdfservices.operation.auth","adobe.pdfservices.operation.exception","adobe.pdfservices.operation.io","adobe.pdfservices.operation.pdfops","adobe.pdfservices.operation.pdfops.options","adobe.pdfservices.operation.pdfops.options.extractpdf","index","modules","reference/index"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":4,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":3,"sphinx.domains.rst":2,"sphinx.domains.std":2,sphinx:56},filenames:["adobe.rst","adobe.pdfservices.rst","adobe.pdfservices.operation.rst","adobe.pdfservices.operation.auth.rst","adobe.pdfservices.operation.exception.rst","adobe.pdfservices.operation.io.rst","adobe.pdfservices.operation.pdfops.rst","adobe.pdfservices.operation.pdfops.options.rst","adobe.pdfservices.operation.pdfops.options.extractpdf.rst","index.rst","modules.rst","reference/index.rst"],objects:{"":[[0,0,0,"-","adobe"]],"adobe.pdfservices":[[2,0,0,"-","operation"]],"adobe.pdfservices.operation":[[3,0,0,"-","auth"],[2,0,0,"-","client_config"],[4,0,0,"-","exception"],[2,0,0,"-","execution_context"],[5,0,0,"-","io"],[2,0,0,"-","operation"],[6,0,0,"-","pdfops"]],"adobe.pdfservices.operation.auth":[[3,0,0,"-","credentials"],[3,0,0,"-","service_account_credentials"]],"adobe.pdfservices.operation.auth.credentials":[[11,1,1,"","Credentials"]],"adobe.pdfservices.operation.auth.credentials.Credentials":[[11,2,1,"","service_account_credentials_builder"]],"adobe.pdfservices.operation.auth.service_account_credentials":[[11,1,1,"","ServiceAccountCredentials"]],"adobe.pdfservices.operation.auth.service_account_credentials.ServiceAccountCredentials":[[11,1,1,"id6","Builder"],[11,3,1,"","account_id"],[11,3,1,"","claim"],[11,3,1,"","client_id"],[11,3,1,"","client_secret"],[11,3,1,"","organization_id"],[11,3,1,"","private_key"]],"adobe.pdfservices.operation.auth.service_account_credentials.ServiceAccountCredentials.Builder":[[11,2,1,"id7","build"],[11,2,1,"id8","from_file"],[11,2,1,"id9","with_account_id"],[11,2,1,"id10","with_client_id"],[11,2,1,"id11","with_client_secret"],[11,2,1,"id12","with_organization_id"],[11,2,1,"id13","with_private_key"]],"adobe.pdfservices.operation.client_config":[[11,1,1,"","ClientConfig"]],"adobe.pdfservices.operation.client_config.ClientConfig":[[11,1,1,"id0","Builder"],[11,2,1,"","builder"]],"adobe.pdfservices.operation.client_config.ClientConfig.Builder":[[11,2,1,"id1","build"],[11,2,1,"id2","from_file"],[11,2,1,"id3","with_connect_timeout"],[11,2,1,"id4","with_pdf_services_uri"],[11,2,1,"id5","with_read_timeout"]],"adobe.pdfservices.operation.exception":[[11,0,0,"-","exceptions"]],"adobe.pdfservices.operation.exception.exceptions":[[11,4,1,"","SdkException"],[11,4,1,"","ServiceApiException"],[11,4,1,"","ServiceUsageException"]],"adobe.pdfservices.operation.exception.exceptions.SdkException":[[11,3,1,"","request_tracking_id"]],"adobe.pdfservices.operation.exception.exceptions.ServiceApiException":[[11,5,1,"","DEFAULT_ERROR_CODE"],[11,5,1,"","DEFAULT_STATUS_CODE"],[11,3,1,"","error_code"],[11,3,1,"","request_tracking_id"],[11,3,1,"","status_code"]],"adobe.pdfservices.operation.exception.exceptions.ServiceUsageException":[[11,5,1,"","DEFAULT_ERROR_CODE"],[11,5,1,"","DEFAULT_STATUS_CODE"],[11,3,1,"","error_code"],[11,3,1,"","request_tracking_id"],[11,3,1,"","status_code"]],"adobe.pdfservices.operation.execution_context":[[11,1,1,"","ExecutionContext"]],"adobe.pdfservices.operation.execution_context.ExecutionContext":[[11,2,1,"","create"]],"adobe.pdfservices.operation.io":[[5,0,0,"-","file_ref"]],"adobe.pdfservices.operation.io.file_ref":[[11,1,1,"","FileRef"]],"adobe.pdfservices.operation.io.file_ref.FileRef":[[11,2,1,"","create_from_local_file"],[11,2,1,"","create_from_stream"],[11,2,1,"","get_media_type"],[11,2,1,"","save_as"],[11,2,1,"","write_to_stream"]],"adobe.pdfservices.operation.operation":[[2,1,1,"","Operation"]],"adobe.pdfservices.operation.operation.Operation":[[2,2,1,"","execute"]],"adobe.pdfservices.operation.pdfops":[[6,0,0,"-","extract_pdf_operation"],[7,0,0,"-","options"]],"adobe.pdfservices.operation.pdfops.autotag_pdf_operation":[[11,1,1,"","AutotagPDFOperation"]],"adobe.pdfservices.operation.pdfops.autotag_pdf_operation.AutotagPDFOperation":[[11,5,1,"","SUPPORTED_SOURCE_MEDIA_TYPES"],[11,2,1,"","create_new"],[11,2,1,"","execute"],[11,2,1,"","get_options"],[11,2,1,"","set_input"],[11,2,1,"","set_options"]],"adobe.pdfservices.operation.pdfops.extract_pdf_operation":[[11,1,1,"","ExtractPDFOperation"]],"adobe.pdfservices.operation.pdfops.extract_pdf_operation.ExtractPDFOperation":[[11,5,1,"","SUPPORTED_SOURCE_MEDIA_TYPES"],[11,2,1,"","create_new"],[11,2,1,"","execute"],[11,2,1,"","get_options"],[11,2,1,"","set_input"],[11,2,1,"","set_options"]],"adobe.pdfservices.operation.pdfops.options":[[8,0,0,"-","extractpdf"]],"adobe.pdfservices.operation.pdfops.options.autotagpdf.autotag_pdf_options":[[11,1,1,"","AutotagPDFOptions"]],"adobe.pdfservices.operation.pdfops.options.autotagpdf.autotag_pdf_options.AutotagPDFOptions":[[11,1,1,"","Builder"],[11,2,1,"","builder"],[11,3,1,"","generate_report"],[11,3,1,"","shift_headings"]],"adobe.pdfservices.operation.pdfops.options.autotagpdf.autotag_pdf_options.AutotagPDFOptions.Builder":[[11,2,1,"","build"],[11,2,1,"","with_generate_report"],[11,2,1,"","with_shift_headings"]],"adobe.pdfservices.operation.pdfops.options.extractpdf":[[8,0,0,"-","extract_element_type"],[8,0,0,"-","extract_pdf_options"],[8,0,0,"-","extract_renditions_element_type"],[8,0,0,"-","table_structure_type"]],"adobe.pdfservices.operation.pdfops.options.extractpdf.extract_element_type":[[8,1,1,"","ExtractElementType"]],"adobe.pdfservices.operation.pdfops.options.extractpdf.extract_element_type.ExtractElementType":[[8,5,1,"","TABLES"],[8,5,1,"","TEXT"]],"adobe.pdfservices.operation.pdfops.options.extractpdf.extract_pdf_options":[[11,1,1,"","ExtractPDFOptions"]],"adobe.pdfservices.operation.pdfops.options.extractpdf.extract_pdf_options.ExtractPDFOptions":[[11,1,1,"","Builder"],[11,2,1,"","builder"],[11,3,1,"","elements_to_extract"],[11,3,1,"","elements_to_extract_renditions"],[11,3,1,"","get_char_info"],[11,3,1,"","include_styling_info"],[11,3,1,"","table_output_format"]],"adobe.pdfservices.operation.pdfops.options.extractpdf.extract_pdf_options.ExtractPDFOptions.Builder":[[11,2,1,"","build"],[11,2,1,"","with_element_to_extract"],[11,2,1,"","with_element_to_extract_renditions"],[11,2,1,"","with_elements_to_extract"],[11,2,1,"","with_elements_to_extract_renditions"],[11,2,1,"","with_get_char_info"],[11,2,1,"","with_include_styling_info"],[11,2,1,"","with_table_structure_format"]],"adobe.pdfservices.operation.pdfops.options.extractpdf.extract_renditions_element_type":[[8,1,1,"","ExtractRenditionsElementType"]],"adobe.pdfservices.operation.pdfops.options.extractpdf.extract_renditions_element_type.ExtractRenditionsElementType":[[8,5,1,"","FIGURES"],[8,5,1,"","TABLES"]],"adobe.pdfservices.operation.pdfops.options.extractpdf.table_structure_type":[[8,1,1,"","TableStructureType"]],"adobe.pdfservices.operation.pdfops.options.extractpdf.table_structure_type.TableStructureType":[[8,5,1,"","CSV"]],adobe:[[1,0,0,"-","pdfservices"]]},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"],"3":["py","property","Python property"],"4":["py","exception","Python exception"],"5":["py","attribute","Python attribute"]},objtypes:{"0":"py:module","1":"py:class","2":"py:method","3":"py:property","4":"py:exception","5":"py:attribute"},terms:{"0":[4,11],"10000":[2,11],"20000":[2,11],"4000":[2,11],"429":[4,11],"abstract":[2,5,11],"boolean":[8,11],"class":[2,3,5,6,8,9,11],"default":[2,4,5,11],"enum":8,"export":[8,11],"int":[2,11],"new":[2,3,6,11],"return":[2,3,4,5,6,8,11],"static":[2,3,5,8,11],"true":[2,6,8,11],"try":[2,6,11],"while":[2,5,6,11],A:[2,3,5,6,11],For:[2,3,5,11],If:[5,11],It:[2,3,5,11],The:[2,3,4,5,6,8,11],__file__:[2,6,11],_io:[5,11],abc:[2,3,5,11],about:11,absolut:[5,11],abspath:[2,6,11],accept:[5,11],access:[3,11],account:[3,11],account_id:[3,11],across:[2,11],ad:11,add:[2,3,6,8,11],addit:[2,3,6,8,11],adequ:[4,11],adob:[10,11],adobeorg:[3,11],after:[2,11],all:[2,3,9,11],allow:[3,11],along:[6,11],an:[2,3,4,5,6,8,11],ani:[2,3,5,6,8,9,11],api:[2,3,4,6,9,11],applic:[3,11],ar:[2,3,6,11],auth:[1,2],authent:[2,11],author:[3,11],autotag_output_fil:11,autotag_pdf_oper:11,autotag_pdf_opt:11,autotagpdf:11,autotagpdfinput:11,autotagpdfoutputfil:11,autotagpdfwithopt:11,base:[2,3,4,5,6,8,11],base_output_path:11,base_path:[2,6,11],been:[3,4,11],behalf:[3,11],benefit:11,bool:[8,11],bound:[8,11],box:[8,11],bufferedread:[5,11],build:[2,3,6,8,11],builder:[2,3,6,8,11],built:[2,3,11],call:[2,3,4,5,6,11],can:[2,3,8,11],charact:[8,11],claim:[3,11],classmethod:[6,11],classpath:[3,11],clean:[6,11],click:[3,9,11],client:[2,3,4,11],client_config:[0,1,11],client_config_file_path:[2,11],client_credenti:[3,11],client_id:[3,11],client_secret:[3,11],clientconfig:2,code:[4,11],com:[3,11],config:2,configur:[2,3,11],connect:[2,11],connect_timeout:[2,11],connecttimeout:[2,11],consist:[2,11],constant:[3,11],consum:[5,11],contain:11,content:[10,11],context:[2,6,11],creat:[2,3,5,6,11],create_from_local_fil:[2,5,6,11],create_from_stream:[5,11],create_kei:[6,11],create_new:[2,6,11],credenti:[1,2,4,6],credentials_file_path:[3,11],csv:[8,11],current:[2,3,8,11],custom:[2,11],default_error_cod:[4,11],default_status_cod:[4,11],defin:[2,8,11],delet:[5,11],desir:[2,11],detail:[4,11],determin:[2,11],differ:[3,11],directori:[3,5,6,11],dirnam:[2,6,11],document:[9,11],doesn:[4,11],e:[5,11],each:[2,11],either:[4,5,11],element:[6,8,11],element_to_extract:[8,11],element_to_extract_rendit:[8,11],elements_to_extract:[8,11],elements_to_extract_rendit:[8,11],elementtyp:8,empti:[8,11],enabl:11,encapsul:[2,11],encount:[2,6,11],enterpris:[3,11],error:[4,6,11],error_cod:[4,11],establish:[2,11],etc:[5,11],eu:[],exampl:[5,11],except:[1,2,6],execut:[2,5,6,11],execution_context:[0,1,6,11],executioncontext:[2,6],exhaust:[4,11],exist:11,exist_ok:11,expos:9,extens:[5,11],extension_media_type_map:[6,11],extensionmediatypemap:[6,11],extract:[3,6,8],extract_element_typ:[6,7,11],extract_pdf_oper:[1,2,11],extract_pdf_opt:[2,6,7,11],extract_renditions_element_typ:[6,7,11],extractelementtyp:[2,6,8,11],extractpdf:[6,7,11],extractpdfinput:[2,6,11],extractpdfoper:[2,6,8],extractpdfopt:[2,6,8],extractrenditionselementtyp:[2,6,8,11],extracttexttablewithfiguretablerendit:[2,6,11],f:11,factori:[3,11],failur:[4,11],figur:[2,6,8,11],file:[2,3,5,6,8,11],file_ref:[1,2,6,11],fileref:[2,5,6],format:[3,5,6,8,11],from:[2,3,5,6,8,11],from_fil:[2,3,6,11],gener:11,generate_report:11,get:[3,6,9,11],get_char_info:[8,11],get_media_typ:[5,11],get_opt:[6,11],greater:[2,11],ha:[3,4,11],have:[8,11],head:11,here:[3,11],how:[6,11],http:[2,4,11],i:[5,11],id:[3,4,11],identifi:[3,5,11],improv:11,ims_base_uri:[3,11],include_styling_info:[8,11],infer:[5,11],info:[8,11],inform:[8,11],input:[6,8,11],input_file_nam:11,input_file_path:11,input_stream:[5,11],instanc:[2,3,5,6,8,11],intern:[3,6,11],io:[1,2,6],issu:[3,11],itself:[3,11],json:[2,3,6,8,11],jwt_base_uri:[3,11],kei:[2,3,11],left:9,level:[8,11],limit:[4,11],link:[2,11],list:[8,11],local:[5,11],local_file_path:[5,11],local_sourc:[5,11],locat:[5,11],log:[2,6,11],look:[3,11],low:11,mai:[6,11],marker:[3,11],media:[5,11],media_typ:[5,11],messag:[4,11],method:[3,5,11],millisecond:[2,11],mime_typ:[6,11],mkdir:11,modul:[9,10],most:11,nav:9,need:[8,11],network:[4,11],none:[2,3,4,5,8,11],number:[2,11],object:[2,3,8,11],onli:[3,8,11],oper:[0,1,9,11],option:[2,3,5,6,11],org_id:[3,11],organ:[3,11],organization_id:[3,11],os:[2,6,11],output:[2,6,8,11],packag:10,param:[],paramet:[2,3,5,6,8,11],parent:11,path:[2,3,5,6,11],pdf:[2,3,6,8],pdf_services_uri:[2,11],pdf_services_url:[],pdfop:[1,2,11],pdfservic:[0,10,11],pem:[3,11],pleas:9,privat:[3,11],private_kei:[3,11],private_key_fil:[3,11],properti:[3,4,8,11],provid:[2,5,11],qualiti:11,quota:[4,11],rais:[6,8,11],reach:[4,11],read:[2,5,11],read_timeout:[2,11],readabl:[5,11],readtimeout:[2,11],refer:[5,9,11],region:[],rel:[5,11],rendit:[6,8,11],replac:11,report:11,report_path:11,repres:[2,4,5,11],request:[2,4,11],request_tracking_id:[4,11],resourc:[2,6,11],respons:[2,6,11],rest:[2,11],result:[2,4,6,11],reus:[2,11],rtype:[],sampl:[2,6,11],save:[5,11],save_a:[2,5,6,11],save_pdf_fil:11,save_xls_fil:11,sdk:[5,11],sdkexcept:[2,4,6,11],secret:[3,11],section:9,see:[6,11],send:[2,11],server:[2,11],servic:[2,3,4,11],service_account_credenti:[1,2,11],service_account_credentials_build:[2,3,6,11],service_const:[3,11],serviceaccountcredenti:3,serviceapiexcept:[2,4,6,11],serviceconst:[3,11],serviceusageerror:[4,11],serviceusageexcept:[2,4,6,11],set:[2,3,6,8,11],set_input:[2,6,11],set_opt:[2,6,11],shift:11,shift_head:11,should:[2,11],side:[4,11],so:11,sourc:[2,6,11],source_file_ref:[6,11],specifi:[5,8,11],start:9,state:[2,3,11],statu:[4,11],status_cod:[4,11],stem:11,store:[6,11],str:[2,3,5,8,11],stream:[5,11],structur:[2,3,6,8,11],style:[8,11],submodul:[0,1,7],subpackag:10,suppli:[6,11],support:[3,6,8,11],supported_source_media_typ:[6,11],synchron:[6,11],system:[6,11],t:[4,11],tabl:[2,6,8,11],table_output_format:[8,11],table_structur:[8,11],table_structure_typ:[6,7,11],tablestructuretyp:[8,11],tag:11,tagged_pdf_path:11,techacct:[3,11],temporari:[5,6,11],text:[2,6,8,11],than:[2,11],thi:[2,3,4,5,6,8,9,11],thrown:[4,11],timeout:[2,11],token:[3,11],tool:[3,11],track:[4,11],type:[2,3,5,6,8,11],typic:[2,4,5,11],underli:[4,11],unknown:[4,11],until:[2,11],up:[3,6,11],uri:[2,11],url:[2,11],us:[2,3,5,6,11],usag:[2,4,6,11],valu:[2,4,8,11],valueerror:[8,11],wait:[2,11],when:[4,5,11],whether:[8,11],which:[3,5,6,8,11],whose:[8,11],with_account_id:[3,11],with_client_id:[3,11],with_client_secret:[3,11],with_connect_timeout:[2,11],with_element_to_extract:[8,11],with_element_to_extract_rendit:[8,11],with_elements_to_extract:[2,6,8,11],with_elements_to_extract_rendit:[2,6,8,11],with_generate_report:11,with_get_char_info:[2,6,8,11],with_include_styling_info:[6,8,11],with_organization_id:[3,11],with_pdf_services_uri:[2,11],with_private_kei:[3,11],with_read_timeout:[2,11],with_shift_head:11,with_table_structure_format:[8,11],within:[3,11],work:[5,11],write_to_stream:[5,11],writer_stream:[5,11],xlsx:11,your:[3,11],zero:[2,11],zip:[2,6,11]},titles:["adobe package","adobe.pdfservices package","adobe.pdfservices.operation package","adobe.pdfservices.operation.auth package","adobe.pdfservices.operation.exception package","adobe.pdfservices.operation.io package","adobe.pdfservices.operation.pdfops package","adobe.pdfservices.operation.pdfops.options package","adobe.pdfservices.operation.pdfops.options.extractpdf package","pdfservices-sdk","src","Overview"],titleterms:{adob:[0,1,2,3,4,5,6,7,8],auth:[3,11],autotag:11,autotagpdfoper:11,autotagpdfopt:11,client_config:2,clientconfig:11,clientconfigbuild:11,config:11,content:[0,1,2,3,4,5,6,7,8],credenti:[3,11],except:[4,11],execution_context:2,executioncontext:11,extract:11,extract_element_typ:8,extract_pdf_oper:6,extract_pdf_opt:8,extract_renditions_element_typ:8,extractpdf:8,extractpdfoper:11,extractpdfopt:11,file_ref:5,fileref:11,io:[5,11],modul:[0,1,2,3,4,5,6,7,8],oper:[2,3,4,5,6,7,8],option:[7,8],overview:11,packag:[0,1,2,3,4,5,6,7,8],pdf:11,pdfop:[6,7,8],pdfservic:[1,2,3,4,5,6,7,8,9],sdk:9,service_account_credenti:3,serviceaccountcredenti:11,serviceaccountcredentialsbuild:11,src:10,submodul:[2,3,4,5,6,8],subpackag:[0,1,2,6,7],table_structure_typ:8}}) \ No newline at end of file diff --git a/setup.py b/setup.py index cb831b7..988b6ce 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ def parse_requirements(filename, session=None): setuptools.setup( name="pdfservices-sdk", - version="1.0.2b2", + version="2.0.0b1", author='Adobe Document Services', author_email='extractapi@adobe.com', license='Apache2', diff --git a/src/adobe/pdfservices/operation/auth/service_account_credentials.py b/src/adobe/pdfservices/operation/auth/service_account_credentials.py index 05e81eb..a401d17 100644 --- a/src/adobe/pdfservices/operation/auth/service_account_credentials.py +++ b/src/adobe/pdfservices/operation/auth/service_account_credentials.py @@ -11,7 +11,7 @@ import os from abc import ABC -from adobe.pdfservices.operation.internal.service_constants import ServiceConstants +from adobe.pdfservices.operation.internal.constants.service_constants import ServiceConstants from adobe.pdfservices.operation.internal.util import path_util, file_utils from .credentials import Credentials from ..internal.util.validation_util import is_empty diff --git a/src/adobe/pdfservices/operation/client_config.py b/src/adobe/pdfservices/operation/client_config.py index 5f57bae..6fcda71 100644 --- a/src/adobe/pdfservices/operation/client_config.py +++ b/src/adobe/pdfservices/operation/client_config.py @@ -9,7 +9,7 @@ # governing permissions and limitations under the License. import json -from adobe.pdfservices.operation.internal.service_constants import ServiceConstants +from adobe.pdfservices.operation.internal.constants.service_constants import ServiceConstants from adobe.pdfservices.operation.internal.util import file_utils @@ -19,9 +19,8 @@ class ClientConfig(object): """ _CONNECT_TIMEOUT_KEY = "connectTimeout" _READ_TIMEOUT_KEY = "readTimeout" - _CPF_SERVICES_KEY = "cpfServices" - _CPF_SERVICES_OPS_CREATE_KEY = "cpfOpsCreateUri" - _CPF_EXTRACT_ANALYZER_ID = "cpfExtractAnalyzerId" + _PDF_SERVICES = "pdf_services" + _PDF_SERVICES_URI = "pdf_services_uri" @staticmethod def builder(): @@ -42,8 +41,7 @@ class Builder: def __init__(self): self._connect_timeout = ServiceConstants.HTTP_CONNECT_TIMEOUT self._read_timeout = ServiceConstants.HTTP_READ_TIMEOUT - self._cpf_ops_create_uri = ServiceConstants.CPF_OPS_CREATE_URI - self._cpf_extract_analyzer_id = ServiceConstants.CPF_OPS_EXTRACT_ANALYZER_ID + self._pdf_services_uri = ServiceConstants.PDF_SERVICES_URI # the time it allows for the client to establish a connection to the server def with_connect_timeout(self, connect_timeout: int): @@ -58,6 +56,17 @@ def with_connect_timeout(self, connect_timeout: int): self._connect_timeout = connect_timeout return self + def with_pdf_services_uri(self, pdf_services_uri: str): + """Sets the pdf services uri link. + + :param pdf_services_uri: url for the new rest api + :type pdf_services_uri: str + :return: This Builder instance to add any additional parameters. + :rtype: ClientConfig.Builder + """ + self._pdf_services_uri = pdf_services_uri + return self + # the time it will wait on a response once connection is estalished def with_read_timeout(self, read_timeout: int): """Sets the read timeout. It should be greater than zero. @@ -95,11 +104,11 @@ def from_file(self, client_config_file_path: str): config_dict = json.loads(config_json_str) self._connect_timeout = int(config_dict.get(ClientConfig._CONNECT_TIMEOUT_KEY, self._connect_timeout)) self._read_timeout = int(config_dict.get(ClientConfig._READ_TIMEOUT_KEY, self._read_timeout)) - cpf_services_config = config_dict.get(ClientConfig._CPF_SERVICES_KEY, {}) - self._cpf_ops_create_uri = cpf_services_config.get(ClientConfig._CPF_SERVICES_OPS_CREATE_KEY, - self._cpf_ops_create_uri) - self._cpf_extract_analyzer_id = cpf_services_config.get(ClientConfig._CPF_EXTRACT_ANALYZER_ID, - self._cpf_extract_analyzer_id) + pdf_services_config = config_dict.get(ClientConfig._PDF_SERVICES) + if pdf_services_config: + pdf_services_uri_node = pdf_services_config.get(ClientConfig._PDF_SERVICES_URI) + if pdf_services_uri_node: + self._pdf_services_uri = pdf_services_uri_node return self def build(self): @@ -110,5 +119,4 @@ def build(self): :rtype: ClientConfig """ from adobe.pdfservices.operation.internal.internal_client_config import InternalClientConfig - return InternalClientConfig(self._connect_timeout, self._read_timeout, self._cpf_ops_create_uri, - self._cpf_extract_analyzer_id) + return InternalClientConfig(self._connect_timeout, self._read_timeout, self._pdf_services_uri) diff --git a/src/adobe/pdfservices/operation/internal/api/dto/request/__init__.py b/src/adobe/pdfservices/operation/internal/api/dto/request/__init__.py index e69de29..5746b24 100644 --- a/src/adobe/pdfservices/operation/internal/api/dto/request/__init__.py +++ b/src/adobe/pdfservices/operation/internal/api/dto/request/__init__.py @@ -0,0 +1,9 @@ +# Copyright 2022 Adobe. All rights reserved. +# This file is licensed to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. You may obtain a copy +# of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under +# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +# OF ANY KIND, either express or implied. See the License for the specific language +# governing permissions and limitations under the License. \ No newline at end of file diff --git a/src/adobe/pdfservices/operation/internal/api/dto/request/asset_upload_uri_request.py b/src/adobe/pdfservices/operation/internal/api/dto/request/asset_upload_uri_request.py new file mode 100644 index 0000000..96ad5dc --- /dev/null +++ b/src/adobe/pdfservices/operation/internal/api/dto/request/asset_upload_uri_request.py @@ -0,0 +1,29 @@ +# Copyright 2021 Adobe. All rights reserved. +# This file is licensed to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. You may obtain a copy +# of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under +# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +# OF ANY KIND, either express or implied. See the License for the specific language +# governing permissions and limitations under the License. +import json + +from adobe.pdfservices.operation.internal.util.json_hint_encoder import JSONHintEncoder + + +class AssetUploadURIRequest: + json_hint = { + 'mediaType': 'mediaType' + } + + def __init__(self, media_type: str): + super().__init__() + self.mediaType = media_type + + @property + def media_type(self): + return self.mediaType + + def to_json(self): + return json.dumps(self, cls=JSONHintEncoder, indent=1, sort_keys=True) diff --git a/src/adobe/pdfservices/operation/internal/api/dto/request/autotagpdf/autotag_pdf_request.py b/src/adobe/pdfservices/operation/internal/api/dto/request/autotagpdf/autotag_pdf_request.py new file mode 100644 index 0000000..a770303 --- /dev/null +++ b/src/adobe/pdfservices/operation/internal/api/dto/request/autotagpdf/autotag_pdf_request.py @@ -0,0 +1,38 @@ +# Copyright 2022 Adobe. All rights reserved. +# This file is licensed to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. You may obtain a copy +# of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under +# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +# OF ANY KIND, either express or implied. See the License for the specific language +# governing permissions and limitations under the License. +import json +from adobe.pdfservices.operation.internal.util.json_hint_encoder import JSONHintEncoder + +from adobe.pdfservices.operation.pdfops.options.autotagpdf.autotag_pdf_options import AutotagPDFOptions +from adobe.pdfservices.operation.internal.api.dto.request.platform.platform_api_request import PlatformApiRequest + + +class AutotagPDFRequest(PlatformApiRequest): + json_hint = { + 'asset_id': 'assetID', + 'generate_report': 'generateReport', + 'shift_headings': 'shiftHeadings' + } + + def __init__(self, asset_id: str= None, generate_report: bool = None, shift_headings: bool = None): + super().__init__() + self.asset_id = asset_id + self.generate_report = generate_report + self.shift_headings = shift_headings + + @classmethod + def from_autotag_pdf_options(cls, asset_id, autotag_pdf_options: AutotagPDFOptions = None): + if autotag_pdf_options is None: + return cls(asset_id=asset_id) + return cls(asset_id=asset_id,generate_report=autotag_pdf_options.generate_report, + shift_headings=autotag_pdf_options.shift_headings) + + def to_json(self): + return json.dumps(self, cls=JSONHintEncoder, indent=1, sort_keys=True) diff --git a/src/adobe/pdfservices/operation/internal/api/dto/request/extract_pdf_request.py b/src/adobe/pdfservices/operation/internal/api/dto/request/extract_pdf_request.py new file mode 100644 index 0000000..59e2bc9 --- /dev/null +++ b/src/adobe/pdfservices/operation/internal/api/dto/request/extract_pdf_request.py @@ -0,0 +1,57 @@ +# Copyright 2021 Adobe. All rights reserved. +# This file is licensed to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. You may obtain a copy +# of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under +# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +# OF ANY KIND, either express or implied. See the License for the specific language +# governing permissions and limitations under the License. +import json +from typing import List + +from adobe.pdfservices.operation.internal.util.json_hint_encoder import JSONHintEncoder + +from adobe.pdfservices.operation.internal.api.dto.request.platform.platform_api_request import PlatformApiRequest +from adobe.pdfservices.operation.pdfops.options.extractpdf.extract_element_type import ExtractElementType +from adobe.pdfservices.operation.pdfops.options.extractpdf.extract_renditions_element_type import \ + ExtractRenditionsElementType +from adobe.pdfservices.operation.pdfops.options.extractpdf.table_structure_type import TableStructureType +from adobe.pdfservices.operation.pdfops.options.extractpdf.extract_pdf_options import ExtractPDFOptions + + +class ExtractPDFRequest(PlatformApiRequest): + json_hint = { + 'asset_id': 'assetID', + 'elements_to_extract': 'elementsToExtract', + 'renditions_to_extract': 'renditionsToExtract', + 'table_output_format': 'tableOutputFormat', + 'extract_char_info': 'getCharBounds', + 'include_styling_info': 'includeStyling' + } + + def __init__(self, asset_id: str = None, elements_to_extract: List[ExtractElementType] = None, + renditions_to_extract: List[ExtractRenditionsElementType] = None, table_output_format: TableStructureType = None, + extract_char_info: bool = None, include_styling_info: bool = None): + super().__init__() + self.asset_id = asset_id + self.elements_to_extract = elements_to_extract + self.renditions_to_extract = renditions_to_extract + self.table_output_format = table_output_format + self.extract_char_info = extract_char_info + self.include_styling_info = include_styling_info + + @classmethod + def from_extract_pdf_options(cls, asset_id: str = None, extract_pdf_options: ExtractPDFOptions = None): + if extract_pdf_options: + return cls(asset_id=asset_id, + elements_to_extract=extract_pdf_options.elements_to_extract, + renditions_to_extract=extract_pdf_options.elements_to_extract_renditions, + table_output_format=extract_pdf_options.table_output_format, + extract_char_info=extract_pdf_options.get_char_info, + include_styling_info=extract_pdf_options.include_styling_info) + else: + return cls(asset_id=asset_id, elements_to_extract=[ExtractElementType.TEXT]) + + def to_json(self): + return json.dumps(self, cls=JSONHintEncoder, indent=1, sort_keys=True) diff --git a/src/adobe/pdfservices/operation/internal/api/dto/request/platform/__init__.py b/src/adobe/pdfservices/operation/internal/api/dto/request/platform/__init__.py index e69de29..5746b24 100644 --- a/src/adobe/pdfservices/operation/internal/api/dto/request/platform/__init__.py +++ b/src/adobe/pdfservices/operation/internal/api/dto/request/platform/__init__.py @@ -0,0 +1,9 @@ +# Copyright 2022 Adobe. All rights reserved. +# This file is licensed to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. You may obtain a copy +# of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under +# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +# OF ANY KIND, either express or implied. See the License for the specific language +# governing permissions and limitations under the License. \ No newline at end of file diff --git a/src/adobe/pdfservices/operation/internal/api/dto/request/platform/platform_api_request.py b/src/adobe/pdfservices/operation/internal/api/dto/request/platform/platform_api_request.py new file mode 100644 index 0000000..4e3ce13 --- /dev/null +++ b/src/adobe/pdfservices/operation/internal/api/dto/request/platform/platform_api_request.py @@ -0,0 +1,16 @@ +# Copyright 2021 Adobe. All rights reserved. +# This file is licensed to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. You may obtain a copy +# of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under +# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +# OF ANY KIND, either express or implied. See the License for the specific language +# governing permissions and limitations under the License. +from abc import ABC + +class PlatformApiRequest(ABC): + + + def __init__(self): + return diff --git a/src/adobe/pdfservices/operation/internal/api/dto/response/__init__.py b/src/adobe/pdfservices/operation/internal/api/dto/response/__init__.py index e69de29..5746b24 100644 --- a/src/adobe/pdfservices/operation/internal/api/dto/response/__init__.py +++ b/src/adobe/pdfservices/operation/internal/api/dto/response/__init__.py @@ -0,0 +1,9 @@ +# Copyright 2022 Adobe. All rights reserved. +# This file is licensed to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. You may obtain a copy +# of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under +# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +# OF ANY KIND, either express or implied. See the License for the specific language +# governing permissions and limitations under the License. \ No newline at end of file diff --git a/src/adobe/pdfservices/operation/internal/api/dto/response/job_status.py b/src/adobe/pdfservices/operation/internal/api/dto/response/job_status.py new file mode 100644 index 0000000..5c16aee --- /dev/null +++ b/src/adobe/pdfservices/operation/internal/api/dto/response/job_status.py @@ -0,0 +1,19 @@ +# Copyright 2021 Adobe. All rights reserved. +# This file is licensed to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. You may obtain a copy +# of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under +# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +# OF ANY KIND, either express or implied. See the License for the specific language +# governing permissions and limitations under the License. +import enum + + +class JobStatus(str, enum.Enum): + """ + enum of status of the response + """ + IN_PROGRESS = "in_progress" + FAILED = "failed" + DONE = "done" diff --git a/src/adobe/pdfservices/operation/internal/api/dto/response/platform/__init__.py b/src/adobe/pdfservices/operation/internal/api/dto/response/platform/__init__.py index e69de29..5746b24 100644 --- a/src/adobe/pdfservices/operation/internal/api/dto/response/platform/__init__.py +++ b/src/adobe/pdfservices/operation/internal/api/dto/response/platform/__init__.py @@ -0,0 +1,9 @@ +# Copyright 2022 Adobe. All rights reserved. +# This file is licensed to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. You may obtain a copy +# of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under +# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +# OF ANY KIND, either express or implied. See the License for the specific language +# governing permissions and limitations under the License. \ No newline at end of file diff --git a/src/adobe/pdfservices/operation/internal/api/dto/response/platform/job_error_response.py b/src/adobe/pdfservices/operation/internal/api/dto/response/platform/job_error_response.py new file mode 100644 index 0000000..34a1c17 --- /dev/null +++ b/src/adobe/pdfservices/operation/internal/api/dto/response/platform/job_error_response.py @@ -0,0 +1,30 @@ +# Copyright 2021 Adobe. All rights reserved. +# This file is licensed to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. You may obtain a copy +# of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under +# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +# OF ANY KIND, either express or implied. See the License for the specific language +# governing permissions and limitations under the License. +class JobErrorResponse: + + json_hint = { + 'code': 'code', + 'status': 'status', + 'message': 'message' + } + + def __init__(self, code: str, message : str, status: int): + self.code = code + self.message = message + self.status = status + + def get_code(self): + return self.code + + def get_message(self): + return self.message + + def get_status(self): + return self.status diff --git a/src/adobe/pdfservices/operation/internal/api/dto/response/platform/platform_api_response.py b/src/adobe/pdfservices/operation/internal/api/dto/response/platform/platform_api_response.py new file mode 100644 index 0000000..10defbc --- /dev/null +++ b/src/adobe/pdfservices/operation/internal/api/dto/response/platform/platform_api_response.py @@ -0,0 +1,39 @@ +# Copyright 2021 Adobe. All rights reserved. +# This file is licensed to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. You may obtain a copy +# of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under +# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +# OF ANY KIND, either express or implied. See the License for the specific language +# governing permissions and limitations under the License. +import json + +from adobe.pdfservices.operation.internal.util.json_hint_encoder import JSONHintEncoder, JSONHintDecoder +from adobe.pdfservices.operation.internal.api.dto.response.platform.job_error_response import JobErrorResponse + + +class PlatformApiResponse: + + json_hint = { + 'status': 'status', + 'error': 'error' + } + + def __init__(self, status: int, error: JobErrorResponse): + self.error = error + self.status = status + + def get_error_response(self): + return self.error + + def get_status(self): + return self.status + + def to_json(self): + return json.dumps(self, cls=JSONHintEncoder, indent=4, sort_keys=True) + + @staticmethod + def from_json(json_str): + JSONHintDecoder.current_class = PlatformApiResponse + return JSONHintDecoder.as_class(json.loads(json_str)) diff --git a/src/adobe/pdfservices/operation/internal/api/platform_api.py b/src/adobe/pdfservices/operation/internal/api/platform_api.py new file mode 100644 index 0000000..4ef9b9a --- /dev/null +++ b/src/adobe/pdfservices/operation/internal/api/platform_api.py @@ -0,0 +1,99 @@ +# Copyright 2022 Adobe. All rights reserved. +# This file is licensed to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. You may obtain a copy +# of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under +# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +# OF ANY KIND, either express or implied. See the License for the specific language +# governing permissions and limitations under the License. +import json +import logging +from datetime import datetime +from http import HTTPStatus +import polling2 +from polling2 import TimeoutException +import requests + +from adobe.pdfservices.operation.internal.api.dto.response.job_status import JobStatus +from adobe.pdfservices.operation.internal.constants.request_key import RequestKey +from adobe.pdfservices.operation.internal.http.response_util import ResponseUtil +from adobe.pdfservices.operation.exception.exceptions import ServiceApiException +from adobe.pdfservices.operation.internal.api.dto.response.platform.platform_api_response import PlatformApiResponse +from adobe.pdfservices.operation.internal.exceptions import OperationException +from adobe.pdfservices.operation.internal.extension_media_type_mapping import ExtensionMediaTypeMapping +from adobe.pdfservices.operation.internal.http.http_request import HttpRequest +from adobe.pdfservices.operation.internal.http.http_method import HttpMethod +from adobe.pdfservices.operation.internal.http.request_header_const import DefaultHeaders +from adobe.pdfservices.operation.internal.http import http_client +from adobe.pdfservices.operation.internal.internal_execution_context import InternalExecutionContext +from adobe.pdfservices.operation.internal.api.dto.request.platform.platform_api_request import PlatformApiRequest + + +class PlatformApi: + operation = '/operation/' + POLLING_TIMEOUT_STATUS_CODE = 0 + + @staticmethod + def submit_job(context: InternalExecutionContext, platform_api_request: PlatformApiRequest, operation_endpoint: str, + x_request_id: str, operation_header_info: str): + http_request = HttpRequest(http_method=HttpMethod.POST, + request_key=RequestKey.PLATFORM, + url=context.client_config.get_pdf_services_uri() + PlatformApi.operation + + operation_endpoint, data=platform_api_request.to_json(), + headers={DefaultHeaders.DC_REQUEST_ID_HEADER_KEY: x_request_id, + DefaultHeaders.X_DCSDK_OPS_INFO_HEADER_NAME: operation_header_info, + DefaultHeaders.CONTENT_TYPE_HEADER_NAME: ExtensionMediaTypeMapping.JSON.mime_type}, + + authenticator=context.authenticator, + connect_timeout=context.client_config.get_connect_timeout(), + read_timeout=context.client_config.get_read_timeout()) + response = http_client.process_request(http_request=http_request, + success_status_codes=[HTTPStatus.CREATED], + error_response_handler=PlatformApi.handle_error_response) + return response.headers.get('location') + + @staticmethod + def status_poll(context: InternalExecutionContext, location: str, x_request_id: str): + def is_correct_response(response): + content = json.loads(response.content) + status = content.get('status') + if status == JobStatus.FAILED: + job_error_response = PlatformApiResponse(status, content.get('error')).get_error_response() + raise ServiceApiException(job_error_response.get('message'), ResponseUtil. + get_request_tracking_id_from_response(response, False), job_error_response + .get('status'), job_error_response.get('code')) + return status == JobStatus.DONE + + start_time = datetime.now() + http_request = HttpRequest(http_method=HttpMethod.GET, + request_key=RequestKey.STATUS, + url=location, + headers={DefaultHeaders.DC_REQUEST_ID_HEADER_KEY: x_request_id}, + authenticator=context.authenticator, + connect_timeout=context.client_config.get_connect_timeout(), + read_timeout=context.client_config.get_read_timeout(), + retryable=True) + try: + + response = polling2.poll( + lambda: http_client.process_request(http_request=http_request, + success_status_codes=[HTTPStatus.OK, HTTPStatus.ACCEPTED], + error_response_handler=PlatformApi.handle_error_response), + check_success=is_correct_response, + step=0.5, + timeout=10 * 60 + ) + logging.debug(f'Total polling time, Latency(ms): {(datetime.now() - start_time).microseconds / 1000}') + return response + except TimeoutException: + logging.error("Polling Timeout reached. Something's wrong, file operation took too long") + raise OperationException(message="Operation execution has timed out!", + error_message="Polling Timeout reached", + request_tracking_id=ResponseUtil.get_request_tracking_id_from_response(response, + True) + , status_code=PlatformApi.POLLING_TIMEOUT_STATUS_CODE) + + @staticmethod + def handle_error_response(response: requests.Response): + pass diff --git a/src/adobe/pdfservices/operation/internal/api/storage_api.py b/src/adobe/pdfservices/operation/internal/api/storage_api.py new file mode 100644 index 0000000..6960cb5 --- /dev/null +++ b/src/adobe/pdfservices/operation/internal/api/storage_api.py @@ -0,0 +1,107 @@ +# Copyright 2022 Adobe. All rights reserved. +# This file is licensed to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. You may obtain a copy +# of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under +# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +# OF ANY KIND, either express or implied. See the License for the specific language +# governing permissions and limitations under the License. + +import logging +from datetime import datetime +from http import HTTPStatus + +import requests +from adobe.pdfservices.operation.internal.constants.request_key import RequestKey +from adobe.pdfservices.operation.internal.exceptions import OperationException +from adobe.pdfservices.operation.exception.exceptions import ServiceApiException, SdkException +from adobe.pdfservices.operation.io.file_ref import FileRef +from adobe.pdfservices.operation.internal.internal_execution_context import InternalExecutionContext +from adobe.pdfservices.operation.internal.extension_media_type_mapping import ExtensionMediaTypeMapping +from adobe.pdfservices.operation.internal.http.request_header_const import DefaultHeaders +from adobe.pdfservices.operation.internal.http import http_client +from adobe.pdfservices.operation.internal.http.http_method import HttpMethod +from adobe.pdfservices.operation.internal.http.http_request import HttpRequest +from adobe.pdfservices.operation.internal.api.dto.request.asset_upload_uri_request import AssetUploadURIRequest + + +class StorageApi: + + assets = "/assets" + + @staticmethod + def upload_to_cloud(context: InternalExecutionContext, uri: str, source_file_ref: FileRef): + try: + http_request = HttpRequest(http_method=HttpMethod.PUT, + request_key=RequestKey.UPLOAD, + url=uri, + data=source_file_ref.get_as_stream(), + headers={DefaultHeaders.CONTENT_TYPE_HEADER_NAME: source_file_ref.get_media_type( + )}, + connect_timeout=context.client_config.get_connect_timeout(), + read_timeout=context.client_config.get_read_timeout()) + response = http_client.process_request(http_request=http_request, + success_status_codes=[HTTPStatus.ACCEPTED, HTTPStatus.OK], + error_response_handler=StorageApi.handle_error_response) + + logging.debug(f'Asset upload response {response}') + + return response + except FileNotFoundError as fe: + raise fe + except IOError as io: + raise SdkException(f'Unexpected error while uploading file {io}') + + @staticmethod + def get_upload_uri(context: InternalExecutionContext, media_type: str, x_request_id: str): + + try: + assetUploadURIRequest = AssetUploadURIRequest(media_type) + + http_request = HttpRequest(http_method=HttpMethod.POST, + request_key=RequestKey.PLATFORM, + url=context.client_config.get_pdf_services_uri() + StorageApi.assets, + data=assetUploadURIRequest.to_json(), + headers={DefaultHeaders.DC_REQUEST_ID_HEADER_KEY: x_request_id, + DefaultHeaders.CONTENT_TYPE_HEADER_NAME: ExtensionMediaTypeMapping.JSON.mime_type} + , authenticator=context.authenticator, + connect_timeout=context.client_config.get_connect_timeout(), + read_timeout=context.client_config.get_read_timeout()) + + response = http_client.process_request(http_request=http_request, + success_status_codes=[HTTPStatus.ACCEPTED, HTTPStatus.OK], + error_response_handler=StorageApi.handle_error_response) + return response + + except OperationException as oex: + raise ServiceApiException(message=oex.error_message, error_code=oex.error_code, + request_tracking_id=oex.request_tracking_id, status_code=oex.status_code) + + @staticmethod + def handle_error_response(response: requests.Response): + pass + + @staticmethod + def download_and_save_file(context: InternalExecutionContext, uri: str, + destination_path: str): + + start_time = datetime.now() + http_request = HttpRequest(http_method=HttpMethod.GET, + request_key=RequestKey.DOWNLOAD, + headers={}, + url=uri, + connect_timeout=context.client_config.get_connect_timeout(), + read_timeout=context.client_config.get_read_timeout()) + + response = http_client.process_request(http_request=http_request, + success_status_codes=[HTTPStatus.OK, HTTPStatus.ACCEPTED], + error_response_handler=StorageApi.handle_error_response) + logging.debug(f'Upload Operation Latency(ms): {(datetime.now() - start_time).microseconds / 1000}') + + logging.info(f'Downloading file to {destination_path}') + + file = FileRef.create_from_local_file(destination_path) + with open(destination_path, 'wb') as f: + f.write(response.content) + return file diff --git a/src/adobe/pdfservices/operation/internal/auth/jwt_authenticator.py b/src/adobe/pdfservices/operation/internal/auth/jwt_authenticator.py index d455755..8200c6b 100644 --- a/src/adobe/pdfservices/operation/internal/auth/jwt_authenticator.py +++ b/src/adobe/pdfservices/operation/internal/auth/jwt_authenticator.py @@ -17,12 +17,13 @@ import jwt from adobe.pdfservices.operation.auth.service_account_credentials import ServiceAccountCredentials -from adobe.pdfservices.operation.exception.exceptions import SdkException, ServiceApiException +from adobe.pdfservices.operation.exception.exceptions import SdkException from adobe.pdfservices.operation.internal.auth.authenticator import Authenticator from adobe.pdfservices.operation.internal.auth.session_token import SessionToken +from adobe.pdfservices.operation.internal.constants.request_key import RequestKey from adobe.pdfservices.operation.internal.exceptions import OperationException from adobe.pdfservices.operation.internal.http.response_util import ResponseUtil -from adobe.pdfservices.operation.internal.service_constants import ServiceConstants, custom_error_messages +from adobe.pdfservices.operation.internal.constants.service_constants import ServiceConstants, custom_error_messages from adobe.pdfservices.operation.internal.http import http_client from adobe.pdfservices.operation.internal.http.http_method import HttpMethod from adobe.pdfservices.operation.internal.http.http_request import HttpRequest @@ -57,8 +58,8 @@ def refresh_token(self): "client_id": self.service_account_configuration.client_id, "client_secret": self.service_account_configuration.client_secret} try: - http_request = HttpRequest(http_method=HttpMethod.POST, url=url, data=access_token_request_payload, - headers={}) + http_request = HttpRequest(http_method=HttpMethod.POST, request_key=RequestKey.AUTHN, url=url, + data=access_token_request_payload, headers={}) response = http_client.process_request(http_request=http_request, success_status_codes=[HTTPStatus.OK], error_response_handler=self.handle_ims_failure) content = json.loads(response.content) diff --git a/src/adobe/pdfservices/operation/internal/constants/__init__.py b/src/adobe/pdfservices/operation/internal/constants/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/adobe/pdfservices/operation/internal/constants/request_key.py b/src/adobe/pdfservices/operation/internal/constants/request_key.py new file mode 100644 index 0000000..43a048d --- /dev/null +++ b/src/adobe/pdfservices/operation/internal/constants/request_key.py @@ -0,0 +1,21 @@ +# Copyright 2021 Adobe. All rights reserved. +# This file is licensed to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. You may obtain a copy +# of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under +# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +# OF ANY KIND, either express or implied. See the License for the specific language +# governing permissions and limitations under the License. +import enum + + +class RequestKey(str, enum.Enum): + """ + enum of RequestKeys in the requests + """ + STATUS = "status" + PLATFORM = "platform" + UPLOAD = "upload" + DOWNLOAD = "download" + AUTHN = "ims.session_token" diff --git a/src/adobe/pdfservices/operation/internal/constants/service_constants.py b/src/adobe/pdfservices/operation/internal/constants/service_constants.py new file mode 100644 index 0000000..a50b2a0 --- /dev/null +++ b/src/adobe/pdfservices/operation/internal/constants/service_constants.py @@ -0,0 +1,59 @@ +# Copyright 2021 Adobe. All rights reserved. +# This file is licensed to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. You may obtain a copy +# of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under +# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +# OF ANY KIND, either express or implied. See the License for the specific language +# governing permissions and limitations under the License. + +custom_error_messages = { + + # Custom IMS error messages + "imsInvalidTokenGenericErrorMessage": 'Either your certificate for PDF Tools API credentials has expired or an ' + + 'invalid Organization_ID/Account_ID has been used in credentials. Please visit Adobe IO ' + + 'Console(http://console.adobe.io/) to update your public certificate to use the same credentials or to check ' + + 'the value of Organization Id or Account ID.', + "imsCertificateExpiredErrorMessage": 'Your certificate for PDF Tools API credentials might have expired. ' + + 'Please visit Adobe IO Console(http://console.adobe.io/) to update your public certificate to use the same ' + + 'credentials.', + + # Service usage exception error messages + "serviceUsageLimitReachedErrorMessage": 'Service usage limit has been reached. Please retry after sometime.', + "integrationServiceUsageLimitReachedErrorMessage": 'Service usage limit has been reached for the integration. ' + + 'Please retry after sometime.', + + # Quota specific exception error messages + "quotaExhaustedErrorMessage": 'Free trial quota exhausted. Please visit (www.adobe.com/go/pdftoolsapi_err_quota) to ' + + 'upgrade to paid credentials.', + "quotaUnavailableErrorMessage": 'Quota for this operation is not available. Please visit ' + + '(www.adobe.com/go/pdftoolsapi_home) to start using free trial quota.' +} + + +class ServiceConstants: + HTTP_CONNECT_TIMEOUT = 4000 + HTTP_READ_TIMEOUT = 10000 + HTTP_MAX_RETRIES = 1 + HTTP_RETRY_DELAY_FACTOR = 2 + HTTP_MAX_RETRYIN_TERVAL = 15000 + HTTP_RETRY_BACKOFF_INTERVAL = 3000 + HTTP_SUCCESS_RESPONSE_CODE = 200, 201, 202, 204 + HTTP_RETRIABLE_RESPONSE_CODE = 401 + APACHE_CLIENT_MAX_CONNECTION = 200 + APACHE_CLIENT_MAX_CONNECTION_PER_ROUTE = 20 + JWT_BASE_URI = 'https://ims-na1.adobelogin.com' + JWT_URI_SUFFIX = 'ims/exchange/jwt/' + JWT_AUDIENCE_SUFFIX = 'c/' + JWT_CLAIM = 's/ent_documentcloud_sdk' + OPERATION_RESULT_TEMP_DIRECTORY = 'sdkResult' + EXTRACT_OPERATION_ENDPOINT = 'extractpdf' + AUTOTAG_OPERATION_ENDPOINT = 'autotag' + TEXT_MIME_TYPE = "text/directory" + EXTRACT_OPERATION_NAME = "EXTRACT_PDF" + AUTOTAG_OPERATION_NAME = "AUTOTAG_PDF" + CONTENT_ANALYZER_REQUESTS_STRING = "contentAnalyzerRequests" + CONTENT_ANALYZER_RESPONSE_STRING = "contentAnalyzerResponse" + ASSET_UPLOAD_URI_REQUESTS_STRING = "assetUploadURIRequests" + PDF_SERVICES_URI = "https://pdf-services.adobe.io" diff --git a/src/adobe/pdfservices/operation/internal/extension_media_type_mapping.py b/src/adobe/pdfservices/operation/internal/extension_media_type_mapping.py index c16dc10..48945a9 100644 --- a/src/adobe/pdfservices/operation/internal/extension_media_type_mapping.py +++ b/src/adobe/pdfservices/operation/internal/extension_media_type_mapping.py @@ -15,6 +15,7 @@ class ExtensionMediaTypeMapping(str, enum.Enum): PDF = "application/pdf" ZIP = "application/zip" XLSX = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + JSON = "application/json" @property def mime_type(self): diff --git a/src/adobe/pdfservices/operation/internal/http/http_client.py b/src/adobe/pdfservices/operation/internal/http/http_client.py index dbc426f..55f9c59 100644 --- a/src/adobe/pdfservices/operation/internal/http/http_client.py +++ b/src/adobe/pdfservices/operation/internal/http/http_client.py @@ -10,19 +10,16 @@ import json import logging import sys -from http import HTTPStatus from typing import Callable, List -import pkg_resources import requests from adobe.pdfservices.operation.exception.exceptions import SdkException -from adobe.pdfservices.operation.internal.exceptions import OperationException from adobe.pdfservices.operation.internal.http.request_header_const import DefaultHeaders -from adobe.pdfservices.operation.internal.http.response_util import ResponseUtil, CPF_STATUS, REPORT, ERROR_CODE, \ - STATUS, TITLE +from adobe.pdfservices.operation.internal.http.response_util import ResponseUtil from adobe.pdfservices.operation.internal.http.http_method import HttpMethod from adobe.pdfservices.operation.internal.http.http_request import HttpRequest +from adobe.pdfservices.operation.internal.exceptions import OperationException _logger = logging.getLogger(__name__) @@ -40,12 +37,12 @@ def process_request(http_request: HttpRequest, success_status_codes: List, while (True): response = _execute_request(http_request) if _handle_response_and_retry(response, success_status_codes, - error_response_handler, not http_request.authenticator) and http_request.retryable: + error_response_handler, not http_request.authenticator, http_request.request_key) and http_request.retryable: _force_authenticate(http_request) # Only single retry is required in case of token expiry http_request.retryable = False else: - if response.status_code not in (200, 202): + if response.status_code not in (200, 201, 202): raise OperationException(message=response.text, status_code=response.status_code, error_code=response.reason, @@ -59,7 +56,7 @@ def _append_default_headers(headers: dict): # Set SDK Info header headers[DefaultHeaders.DC_APP_INFO_HEADER_KEY] = "{lang}-{name}-{version}".format(lang="python", name='pdfservices-sdk', - version='1.0.2b2') + version='2.0.0b1') headers[DefaultHeaders.ACCEPT_HEADER_NAME] = DefaultHeaders.JSON_TXT_CONTENT_TYPE @@ -84,7 +81,11 @@ def _execute_request(http_request: HttpRequest): elif http_request.method == HttpMethod.GET: response = requests.get(url=http_request.url, allow_redirects=True, headers=http_request.headers, timeout=timeout) - except Exception: + elif http_request.method == HttpMethod.PUT: + response = requests.put(url=http_request.url, data=http_request.data, headers=http_request.headers, + timeout=timeout) + + except Exception as e: raise SdkException("Request could not be completed. Possible cause attached!", sys.exc_info()) return response @@ -95,25 +96,9 @@ def _force_authenticate(http_request: HttpRequest): http_request.headers[DefaultHeaders.AUTHORIZATION_HEADER_NAME] = "Bearer " + access_token -def _handle_response_and_retry(response: requests.Response, success_status_codes, error_response_handler, is_ims_api): +def _handle_response_and_retry(response: requests.Response, success_status_codes, error_response_handler, is_ims_api, request_key: str): if response.status_code not in success_status_codes: _logger.debug( "Failure response code {error_code} encountered from backend".format(error_code=response.status_code)) - should_retry = ResponseUtil.handle_api_failures(response, is_ims_api) + should_retry = ResponseUtil.handle_api_failures(response, request_key, is_ims_api) return should_retry if should_retry else error_response_handler(response) - elif response.status_code != HTTPStatus.ACCEPTED and "multipart" not in response.headers["Content-Type"]: - content = json.loads(response.content) - if content.get(CPF_STATUS, None): - cpf_status = content.get(CPF_STATUS, None) - report_error_code = "UNKNOWN" - if cpf_status.get(REPORT, None): - report_error_code = ResponseUtil._get_report_error_code(response_content=content) - if cpf_status.get(STATUS, '') not in success_status_codes: - raise OperationException(message="Error response received for request", - request_tracking_id=ResponseUtil.get_request_tracking_id_from_response(response, - False), - status_code=cpf_status.get(STATUS, ''), - error_message=cpf_status.get(TITLE, ""), - report_error_code=report_error_code) - - diff --git a/src/adobe/pdfservices/operation/internal/http/http_request.py b/src/adobe/pdfservices/operation/internal/http/http_request.py index 056b5ac..c5ff52f 100644 --- a/src/adobe/pdfservices/operation/internal/http/http_request.py +++ b/src/adobe/pdfservices/operation/internal/http/http_request.py @@ -14,9 +14,10 @@ class HttpRequest: # (url, data/files, headers, authenticator (if none its not authenticated), socket_timeout, connect_timeout) - def __init__(self, http_method: HttpMethod, url: str, headers: dict, data=None, files=None, + def __init__(self, http_method: HttpMethod, request_key: str, url: str, headers: dict, data=None, files=None, authenticator: Authenticator = None, read_timeout=None, connect_timeout=None, retryable:bool=False): self.method = http_method + self.request_key = request_key self.url = url self.headers = headers self.data = data diff --git a/src/adobe/pdfservices/operation/internal/http/response_util.py b/src/adobe/pdfservices/operation/internal/http/response_util.py index ce912c8..9198764 100644 --- a/src/adobe/pdfservices/operation/internal/http/response_util.py +++ b/src/adobe/pdfservices/operation/internal/http/response_util.py @@ -9,20 +9,23 @@ # governing permissions and limitations under the License. import json import logging +from xml.etree.ElementTree import fromstring +from xml.sax import SAXParseException import requests -from adobe.pdfservices.operation.exception.exceptions import ServiceUsageException +from adobe.pdfservices.operation.exception.exceptions import ServiceUsageException, ServiceApiException +from adobe.pdfservices.operation.internal.constants.request_key import RequestKey from adobe.pdfservices.operation.internal.exceptions import OperationException -CPF_STATUS="cpf:status" -STATUS="status" -ERROR_CODE="error_code" -TITLE="title" -ERROR="error" -REASON="reason" -REPORT="report" -MESSAGE="message" +CPF_STATUS = "cpf:status" +STATUS = "status" +ERROR_CODE = "error_code" +TITLE = "title" +ERROR = "error" +REASON = "reason" +REPORT = "report" +MESSAGE = "message" class ResponseUtil: _logger = logging.getLogger(__name__) @@ -55,7 +58,7 @@ class ResponseUtil: "(www.adobe.com/go/pdftoolsapi_home) to start using free trial quota or (www.adobe.com/go/pdftoolsapi_err_quota) to upgrade to paid credentials." @staticmethod - def handle_api_failures(response: requests.Response, is_ims_call=False): + def handle_api_failures(response: requests.Response, request_key, is_ims_call=False): # Check if we need a custom error message for this status code custom_error_message = ResponseUtil.CUSTOM_ERROR_MESSAGES_STATUS_CODE_MAPPING.get(response.status_code) if custom_error_message: @@ -65,6 +68,7 @@ def handle_api_failures(response: requests.Response, is_ims_call=False): error_message=custom_error_message.get(MESSAGE), request_tracking_id=ResponseUtil.get_request_tracking_id_from_response(response, is_ims_call)) + ResponseUtil.handle_upload_asset_failure(response, request_key) # Special handling for service usage exception cases if response.status_code == 429: ResponseUtil.handle_service_usage_failure(response) @@ -93,14 +97,29 @@ def handle_service_usage_failure(response): elif ResponseUtil.SERVICE_USAGE_EXCEPTION_STATUS_CODE_429002_STRING == response_content.get(ERROR_CODE, None): response_content[MESSAGE] = ResponseUtil.INTEGRATION_SERVICE_USAGE_LIMIT_REACHED_ERROR_MESSAGE - raise ServiceUsageException(message=response_content.get(MESSAGE, None), + raise ServiceUsageException(message=response_content.get('error').get('message'), request_tracking_id=ResponseUtil.get_request_tracking_id_from_response(response, False), error_code=error_code, status_code=response.status_code) + @staticmethod + def handle_upload_asset_failure(response, request_key): + if request_key == RequestKey.UPLOAD: + try: + response_content = fromstring(response.content) + error_code = response_content.find('Code').text + request_id = response_content.find('RequestId').text + error_message = response_content.find('Message').text + status_code = response.status_code + except SAXParseException: + raise ServiceApiException("Error in uploading file") + raise OperationException(message="Error response received for request", status_code=status_code, + request_tracking_id=request_id,error_message=error_message,error_code=error_code) + @staticmethod def handle_cpf_error_response(response): + response_content = json.loads(response.content) error_code = response_content.get(ERROR_CODE, None) error_message = response_content.get(MESSAGE, None) diff --git a/src/adobe/pdfservices/operation/internal/internal_client_config.py b/src/adobe/pdfservices/operation/internal/internal_client_config.py index 420a1a5..6eb7397 100644 --- a/src/adobe/pdfservices/operation/internal/internal_client_config.py +++ b/src/adobe/pdfservices/operation/internal/internal_client_config.py @@ -9,7 +9,7 @@ # governing permissions and limitations under the License. from adobe.pdfservices.operation.client_config import ClientConfig -from adobe.pdfservices.operation.internal.service_constants import ServiceConstants +from adobe.pdfservices.operation.internal.constants.service_constants import ServiceConstants class InternalClientConfig(ClientConfig): @@ -18,19 +18,15 @@ class InternalClientConfig(ClientConfig): # Setting default values is required for when client config is not provided explicitly. def __init__(self, connect_timeout: int = ServiceConstants.HTTP_CONNECT_TIMEOUT, read_timeout: int = ServiceConstants.HTTP_READ_TIMEOUT, - cpf_ops_create_uri: str = ServiceConstants.CPF_OPS_CREATE_URI, - cpf_extract_analyzer_id: str = ServiceConstants.CPF_OPS_EXTRACT_ANALYZER_ID): + pdf_services_uri: str = ServiceConstants.PDF_SERVICES_URI): + super().__init__() self._connect_timeout = connect_timeout self._read_timeout = read_timeout - self._cpf_ops_create_uri = cpf_ops_create_uri - self._cpf_extract_analyzer_id = cpf_extract_analyzer_id - - def get_cpf_ops_create_uri(self): - return self._cpf_ops_create_uri + self._pdf_services_uri = pdf_services_uri - def get_cpf_extract_service_id(self): - return self._cpf_extract_analyzer_id + def get_pdf_services_uri(self): + return self._pdf_services_uri def get_cpf_autotag_service_id(self): return ServiceConstants.CPF_OPS_AUTOTAG_ANALYZER_ID diff --git a/src/adobe/pdfservices/operation/internal/internal_execution_context.py b/src/adobe/pdfservices/operation/internal/internal_execution_context.py index c5fcb75..97f22e0 100644 --- a/src/adobe/pdfservices/operation/internal/internal_execution_context.py +++ b/src/adobe/pdfservices/operation/internal/internal_execution_context.py @@ -10,10 +10,8 @@ from adobe.pdfservices.operation.auth.service_account_credentials import ServiceAccountCredentials from adobe.pdfservices.operation.execution_context import ExecutionContext -from adobe.pdfservices.operation.internal.http.request_header_const import DefaultHeaders from adobe.pdfservices.operation.internal.auth.auth_factory import AuthenticatorFactory -from adobe.pdfservices.operation.internal.service_constants import ServiceConstants from adobe.pdfservices.operation.internal.internal_client_config import InternalClientConfig diff --git a/src/adobe/pdfservices/operation/internal/io/file_ref_impl.py b/src/adobe/pdfservices/operation/internal/io/file_ref_impl.py index 383e838..8ff58ac 100644 --- a/src/adobe/pdfservices/operation/internal/io/file_ref_impl.py +++ b/src/adobe/pdfservices/operation/internal/io/file_ref_impl.py @@ -14,7 +14,7 @@ from io import BufferedWriter from adobe.pdfservices.operation.exception.exceptions import SdkException -from adobe.pdfservices.operation.internal.service_constants import ServiceConstants +from adobe.pdfservices.operation.internal.constants.service_constants import ServiceConstants from adobe.pdfservices.operation.internal.extension_media_type_mapping import ExtensionMediaTypeMapping from adobe.pdfservices.operation.internal.util.path_util import get_extension from adobe.pdfservices.operation.io.file_ref import FileRef @@ -27,7 +27,10 @@ def get_media_type(self): def get_as_stream(self): if self._file_path: - return open(self._file_path, 'rb') + file = open(self._file_path, 'rb') + file_content = file.read() + file.close() + return file_content else: file_stream = self._input_stream return file_stream diff --git a/src/adobe/pdfservices/operation/internal/response/asset_upload_uri_response.py b/src/adobe/pdfservices/operation/internal/response/asset_upload_uri_response.py new file mode 100644 index 0000000..d0708ee --- /dev/null +++ b/src/adobe/pdfservices/operation/internal/response/asset_upload_uri_response.py @@ -0,0 +1,28 @@ +# Copyright 2022 Adobe. All rights reserved. +# This file is licensed to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. You may obtain a copy +# of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under +# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +# OF ANY KIND, either express or implied. See the License for the specific language +# governing permissions and limitations under the License. +class AssetUploadURIResponse: + json_hint = { + 'uploadUri': 'uploadUri', + 'assetID': 'assetID' + } + + def __init__(self, upload_uri: str, + asset_id: str): + super().__init__() + self._upload_uri = upload_uri + self._asset_iD = asset_id + + @property + def upload_uri(self): + return self._upload_uri + + @property + def asset_id(self): + return self._asset_id diff --git a/src/adobe/pdfservices/operation/internal/service/autotag_pdf_service.py b/src/adobe/pdfservices/operation/internal/service/autotag_pdf_service.py new file mode 100644 index 0000000..98ede69 --- /dev/null +++ b/src/adobe/pdfservices/operation/internal/service/autotag_pdf_service.py @@ -0,0 +1,51 @@ +# Copyright 2021 Adobe. All rights reserved. +# This file is licensed to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. You may obtain a copy +# of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under +# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +# OF ANY KIND, either express or implied. See the License for the specific language +# governing permissions and limitations under the License. + +import json + +from adobe.pdfservices.operation.io.file_ref import FileRef +from adobe.pdfservices.operation.pdfops.options.autotagpdf.autotag_pdf_options import AutotagPDFOptions +from adobe.pdfservices.operation.internal.internal_execution_context import InternalExecutionContext +from adobe.pdfservices.operation.internal.api.platform_api import PlatformApi +from adobe.pdfservices.operation.internal.constants.service_constants import ServiceConstants +from adobe.pdfservices.operation.internal.api.storage_api import StorageApi +from adobe.pdfservices.operation.internal.api.dto.request.autotagpdf.autotag_pdf_request import AutotagPDFRequest + + +class AutotagPDFService: + + @staticmethod + def autotag_pdf(context: InternalExecutionContext, source_file_ref: FileRef, autotag_pdf_options: AutotagPDFOptions, + x_request_id: str): + + try: + get_upload_uri_response = StorageApi.get_upload_uri(context, source_file_ref.get_media_type(), x_request_id) + + content = json.loads(get_upload_uri_response.content) + asset_id = content.get('assetID') + StorageApi.upload_to_cloud(context, content.get('uploadUri'), source_file_ref) + autotag_pdf_request = AutotagPDFRequest.from_autotag_pdf_options(asset_id, autotag_pdf_options) + location = PlatformApi.submit_job(context, autotag_pdf_request, ServiceConstants.AUTOTAG_OPERATION_ENDPOINT, + x_request_id, ServiceConstants.AUTOTAG_OPERATION_NAME) + status_poll_response = PlatformApi.status_poll(context, location, x_request_id) + + download_uri_list = [] + taggedpdf_download_uri = json.loads(status_poll_response.content).get('tagged-pdf').get('downloadUri') + download_uri_list.append(taggedpdf_download_uri) + + if autotag_pdf_options is not None and autotag_pdf_options.generate_report == True: + report_download_uri = json.loads(status_poll_response.content).get('report').get('downloadUri') + download_uri_list.append(report_download_uri) + + return download_uri_list + except FileNotFoundError as fe: + raise fe + except Exception as e: + raise e diff --git a/src/adobe/pdfservices/operation/internal/service/extract_pdf_service.py b/src/adobe/pdfservices/operation/internal/service/extract_pdf_service.py new file mode 100644 index 0000000..5bc75e4 --- /dev/null +++ b/src/adobe/pdfservices/operation/internal/service/extract_pdf_service.py @@ -0,0 +1,44 @@ +# Copyright 2021 Adobe. All rights reserved. +# This file is licensed to you under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. You may obtain a copy +# of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under +# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS +# OF ANY KIND, either express or implied. See the License for the specific language +# governing permissions and limitations under the License. + +import json + +from adobe.pdfservices.operation.io.file_ref import FileRef +from adobe.pdfservices.operation.pdfops.options.extractpdf.extract_pdf_options import ExtractPDFOptions +from adobe.pdfservices.operation.internal.internal_execution_context import InternalExecutionContext +from adobe.pdfservices.operation.internal.api.platform_api import PlatformApi +from adobe.pdfservices.operation.internal.constants.service_constants import ServiceConstants +from adobe.pdfservices.operation.internal.api.dto.request.extract_pdf_request import ExtractPDFRequest +from adobe.pdfservices.operation.internal.api.storage_api import StorageApi + + +class ExtractPDFService: + + @staticmethod + def extract_pdf(context: InternalExecutionContext, source_file_ref: FileRef, extract_pdf_options: ExtractPDFOptions, + x_request_id: str): + + try: + get_upload_uri_response = StorageApi.get_upload_uri(context, source_file_ref.get_media_type(), x_request_id) + + content = json.loads(get_upload_uri_response.content) + asset_id = content.get('assetID') + StorageApi.upload_to_cloud(context, content.get('uploadUri'), source_file_ref) + extract_pdf_request = ExtractPDFRequest.from_extract_pdf_options(asset_id, extract_pdf_options) + location = PlatformApi.submit_job(context, extract_pdf_request, ServiceConstants.EXTRACT_OPERATION_ENDPOINT, + x_request_id, ServiceConstants.EXTRACT_OPERATION_NAME) + + status_poll_response = PlatformApi.status_poll(context, location, x_request_id) + download_uri = json.loads(status_poll_response.content).get('resource').get('downloadUri') + return download_uri + except FileNotFoundError as fe: + raise fe + except Exception as e: + raise e diff --git a/src/adobe/pdfservices/operation/internal/util/file_utils.py b/src/adobe/pdfservices/operation/internal/util/file_utils.py index c510a62..709a498 100644 --- a/src/adobe/pdfservices/operation/internal/util/file_utils.py +++ b/src/adobe/pdfservices/operation/internal/util/file_utils.py @@ -8,12 +8,6 @@ # OF ANY KIND, either express or implied. See the License for the specific language # governing permissions and limitations under the License. -import os -import tempfile -import uuid -from typing import Optional - -from adobe.pdfservices.operation.internal.service_constants import ServiceConstants from adobe.pdfservices.operation.internal.util.path_util import get_file_path diff --git a/src/adobe/pdfservices/operation/internal/util/path_util.py b/src/adobe/pdfservices/operation/internal/util/path_util.py index c5356a9..54909d2 100644 --- a/src/adobe/pdfservices/operation/internal/util/path_util.py +++ b/src/adobe/pdfservices/operation/internal/util/path_util.py @@ -12,7 +12,7 @@ import uuid from typing import Optional -from adobe.pdfservices.operation.internal.service_constants import ServiceConstants +from adobe.pdfservices.operation.internal.constants.service_constants import ServiceConstants def get_extension(file_path): diff --git a/src/adobe/pdfservices/operation/io/file_ref.py b/src/adobe/pdfservices/operation/io/file_ref.py index d68155f..61a8194 100644 --- a/src/adobe/pdfservices/operation/io/file_ref.py +++ b/src/adobe/pdfservices/operation/io/file_ref.py @@ -66,4 +66,11 @@ def save_as(self, local_file_path: str): @abstractmethod def write_to_stream(self, writer_stream): - pass \ No newline at end of file + pass + + def get_media_type(self): + """ + returns the media type + """ + return self._media_type + diff --git a/src/adobe/pdfservices/operation/pdfops/autotag_pdf_operation.py b/src/adobe/pdfservices/operation/pdfops/autotag_pdf_operation.py index 5de12e2..5ef7c9a 100644 --- a/src/adobe/pdfservices/operation/pdfops/autotag_pdf_operation.py +++ b/src/adobe/pdfservices/operation/pdfops/autotag_pdf_operation.py @@ -9,6 +9,7 @@ # governing permissions and limitations under the License. import logging +import uuid from adobe.pdfservices.operation.exception.exceptions import ServiceApiException from adobe.pdfservices.operation.execution_context import ExecutionContext @@ -17,13 +18,14 @@ from adobe.pdfservices.operation.internal.exceptions import OperationException from adobe.pdfservices.operation.internal.extension_media_type_mapping import ExtensionMediaTypeMapping from adobe.pdfservices.operation.internal.internal_execution_context import InternalExecutionContext -from adobe.pdfservices.operation.internal.service.autotagpdf.autotag_pdf_api import AutotagPDFAPI +from adobe.pdfservices.operation.internal.api.storage_api import StorageApi from adobe.pdfservices.operation.internal.util.file_utils import get_transaction_id from adobe.pdfservices.operation.internal.util.path_util import get_temporary_destination_path from adobe.pdfservices.operation.internal.util.validation_util import validate_media_type from adobe.pdfservices.operation.io.file_ref import FileRef from adobe.pdfservices.operation.operation import Operation from adobe.pdfservices.operation.pdfops.options.autotagpdf.autotag_pdf_options import AutotagPDFOptions +from adobe.pdfservices.operation.internal.service.autotag_pdf_service import AutotagPDFService class AutotagPDFOperation(Operation): @@ -108,6 +110,14 @@ def set_options(self, autotag_pdf_options: AutotagPDFOptions): self._autotag_pdf_options = autotag_pdf_options return self + def get_options(self): + """gets the AutotagPDFOptions. + + :return: The options parameter of the operation + :rtype: AutotagPDFOptions + """ + return self._autotag_pdf_options + def set_input(self, source_file_ref: FileRef): """ Sets an input file. @@ -139,21 +149,32 @@ def execute(self, execution_context: ExecutionContext): self._validate(execution_context=execution_context) self._logger.info("All validations successfully done. Beginning AutotagPDF operation execution") - location = AutotagPDFAPI.autotag_pdf(execution_context, self._source_file_ref, self._autotag_pdf_options) + x_request_id = str(uuid.uuid1()) + download_uri_list = AutotagPDFService.autotag_pdf(execution_context, self._source_file_ref, self.get_options(), + x_request_id) self._is_invoked = True - file_location_pdf = get_temporary_destination_path(target_extension=ExtensionMediaTypeMapping.PDF.extension) - file_location_xlsx = get_temporary_destination_path( + temporary_tagged_pdf_destination_path = get_temporary_destination_path(target_extension=ExtensionMediaTypeMapping.PDF.extension) + temporary_report_destination_path = get_temporary_destination_path( target_extension=ExtensionMediaTypeMapping.XLSX.extension) - autotag_pdf_output_files: AutotagPDFOutputFiles = AutotagPDFAPI.download_and_save(location=location, - context=execution_context, - file_location_pdf=file_location_pdf, - file_location_xlsx=file_location_xlsx) - self._logger.info("Autotag Operation Successful - Transaction ID: %s", get_transaction_id(location)) + StorageApi.download_and_save_file(execution_context, download_uri_list[0], + temporary_tagged_pdf_destination_path) + + autotag_pdf_output_files = AutotagPDFOutputFiles() + autotag_pdf_output_files.pdf_file = FileRef.create_from_local_file(temporary_tagged_pdf_destination_path) + + if self.get_options() is not None and self.get_options().generate_report == True: + StorageApi.download_and_save_file(execution_context, download_uri_list[1], + temporary_report_destination_path) + autotag_pdf_output_files.xls_file = FileRef.create_from_local_file(temporary_report_destination_path) + + self._logger.info("Autotag Operation Successful - Request ID: %s", x_request_id) return autotag_pdf_output_files - except OperationException as oex: - raise ServiceApiException(message=oex.error_message, error_code=oex.error_code, - request_tracking_id=oex.request_tracking_id, - status_code=oex.status_code) from None + + except ServiceApiException as se: + raise se + + except Exception as ex: + raise ex def _validate_invocation_count(self): if self._is_invoked: diff --git a/src/adobe/pdfservices/operation/pdfops/extract_pdf_operation.py b/src/adobe/pdfservices/operation/pdfops/extract_pdf_operation.py index 6fcf5d8..11e23ef 100644 --- a/src/adobe/pdfservices/operation/pdfops/extract_pdf_operation.py +++ b/src/adobe/pdfservices/operation/pdfops/extract_pdf_operation.py @@ -9,15 +9,14 @@ # governing permissions and limitations under the License. import logging -from typing import List +import uuid from adobe.pdfservices.operation.exception.exceptions import ServiceApiException from adobe.pdfservices.operation.execution_context import ExecutionContext -from adobe.pdfservices.operation.internal.api.cpf_api import CPFApi -from adobe.pdfservices.operation.internal.exceptions import OperationException +from adobe.pdfservices.operation.internal.api.storage_api import StorageApi from adobe.pdfservices.operation.internal.extension_media_type_mapping import ExtensionMediaTypeMapping from adobe.pdfservices.operation.internal.internal_execution_context import InternalExecutionContext -from adobe.pdfservices.operation.internal.service.extract_pdf_api import ExtractPDFAPI +from adobe.pdfservices.operation.internal.service.extract_pdf_service import ExtractPDFService from adobe.pdfservices.operation.internal.util.file_utils import get_transaction_id from adobe.pdfservices.operation.internal.util.path_util import get_temporary_destination_path from adobe.pdfservices.operation.internal.util.validation_util import validate_media_type @@ -85,6 +84,14 @@ def create_new(cls): """ return ExtractPDFOperation(cls.__create_key) + def get_options(self): + """gets the ExtractPDFOptions. + + :return: The options parameter of the operation + :rtype: ExtractPDFOptions + """ + return self._extract_pdf_options + def set_options(self, extract_pdf_options: ExtractPDFOptions): """ sets the ExtractPDFOptions. @@ -128,15 +135,23 @@ def execute(self, execution_context: ExecutionContext): self._validate(execution_context=execution_context) self._logger.info("All validations successfully done. Beginning ExtractPDF operation execution") - location = ExtractPDFAPI.extract_pdf(execution_context, self._source_file_ref, self._extract_pdf_options) - self._is_invoked = True + x_request_id = str(uuid.uuid4()) + download_uri = ExtractPDFService.extract_pdf(execution_context, self._source_file_ref, self.get_options(), + x_request_id) + file_location = get_temporary_destination_path(target_extension=ExtensionMediaTypeMapping.ZIP.extension) - ExtractPDFAPI.download_and_save(location=location, context=execution_context, file_location=file_location) - self._logger.info("Extract Operation Successful - Transaction ID: %s", get_transaction_id(location)) - return FileRef.create_from_local_file(file_location) - except OperationException as oex: - raise ServiceApiException(message=oex.error_message, error_code=oex.error_code, - request_tracking_id=oex.request_tracking_id, status_code=oex.status_code) from None + + file = StorageApi.download_and_save_file(execution_context, download_uri, file_location) + + self._logger.info(f'Extract Operation Successful - Transaction ID: {get_transaction_id(x_request_id)}') + + return file + + except ServiceApiException as se: + raise se + + except Exception as ex: + raise ex def _validate_invocation_count(self): if self._is_invoked: