From 4c11f65f202ef8f71bfd640232ed30ccd6f4c3a4 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 15 Aug 2018 21:47:00 -0700 Subject: improve handling of invalid identifiers --- python/tests/files/0000-0001-8254-710X.json | 1 + .../files/crossref-works.2018-01-21.badsample.json | 1 + python/tests/importer.py | 20 ++++++++++++++++++++ python/tests/orcid.py | 4 ++++ 4 files changed, 26 insertions(+) create mode 100644 python/tests/files/0000-0001-8254-710X.json (limited to 'python/tests') diff --git a/python/tests/files/0000-0001-8254-710X.json b/python/tests/files/0000-0001-8254-710X.json new file mode 100644 index 00000000..094cae67 --- /dev/null +++ b/python/tests/files/0000-0001-8254-710X.json @@ -0,0 +1 @@ +{"orcid-identifier":{"uri":"http://orcid.org/0000-0001-8254-710X","path":"0000-0001-8254-710X","host":"orcid.org"},"preferences":{"locale":"en"},"history":{"creation-method":"Member-referred","completion-date":null,"submission-date":{"value":1407501041999},"last-modified-date":{"value":1465949566770},"claimed":true,"source":null,"deactivation-date":null,"verified-email":true,"verified-primary-email":true},"person":{"last-modified-date":null,"name":{"created-date":{"value":1460755375159},"last-modified-date":{"value":1460755375159},"given-names":{"value":"Man-Hui"},"family-name":{"value":"Li"},"credit-name":null,"source":null,"visibility":"public","path":"0000-0001-8254-710X"},"other-names":{"last-modified-date":null,"other-name":null,"path":"/0000-0001-8254-710X/other-names"},"biography":{"created-date":{"value":1460755375161},"last-modified-date":{"value":1460755375161},"content":null,"visibility":"public","path":"/0000-0001-8254-710X/biography"},"researcher-urls":{"last-modified-date":null,"researcher-url":null,"path":"/0000-0001-8254-710X/researcher-urls"},"emails":{"last-modified-date":null,"email":null,"path":"/0000-0001-8254-710X/email"},"addresses":{"last-modified-date":null,"address":null,"path":"/0000-0001-8254-710X/address"},"keywords":{"last-modified-date":null,"keyword":null,"path":"/0000-0001-8254-710X/keywords"},"external-identifiers":{"last-modified-date":null,"external-identifier":null,"path":"/0000-0001-8254-710X/external-identifiers"},"path":"/0000-0001-8254-710X/person"},"activities-summary":{"last-modified-date":null,"educations":{"last-modified-date":null,"education-summary":null,"path":"/0000-0001-8254-710X/educations"},"employments":{"last-modified-date":null,"employment-summary":null,"path":"/0000-0001-8254-710X/employments"},"fundings":{"last-modified-date":null,"group":null,"path":"/0000-0001-8254-710X/fundings"},"peer-reviews":{"last-modified-date":null,"group":null,"path":"/0000-0001-8254-710X/peer-reviews"},"works":{"last-modified-date":null,"group":null,"path":"/0000-0001-8254-710X/works"},"path":"/0000-0001-8254-710X/activities"},"path":"/0000-0001-8254-710X"} diff --git a/python/tests/files/crossref-works.2018-01-21.badsample.json b/python/tests/files/crossref-works.2018-01-21.badsample.json index d0ce191f..931da7a7 100644 --- a/python/tests/files/crossref-works.2018-01-21.badsample.json +++ b/python/tests/files/crossref-works.2018-01-21.badsample.json @@ -9,5 +9,6 @@ { "_id" : { "$oid" : "5a55196988a035a45bda0cb1" }, "indexed" : { "date-parts" : [ [ 2017, 10, 23 ] ], "date-time" : "2017-10-23T14:41:48Z", "timestamp" : { "$numberLong" : "1508769708308" } }, "reference-count" : 44, "publisher" : "Elsevier BV", "issue" : "1", "license" : [ { "URL" : "http://www.elsevier.com/tdm/userlicense/1.0/", "start" : { "date-parts" : [ [ 1998, 11, 1 ] ], "date-time" : "1998-11-01T00:00:00Z", "timestamp" : { "$numberLong" : "909878400000" } }, "delay-in-days" : 0, "content-version" : "tdm" } ], "content-domain" : { "domain" : [], "crossmark-restriction" : false }, "short-container-title" : [ "Toxicology and Applied Pharmacology" ], "published-print" : { "date-parts" : [ [ 1998, 11 ] ] }, "DOI" : "10.1006/taap.1998.8543", "type" : "journal-article", "created" : { "date-parts" : [ [ 2002, 9, 18 ] ], "date-time" : "2002-09-18T22:01:25Z", "timestamp" : { "$numberLong" : "1032386485000" } }, "page" : "102-108", "source" : "Crossref", "is-referenced-by-count" : 44, "title" : [ "Role of CYP1A2 in the Hepatotoxicity of Acetaminophen: Investigations UsingCyp1a2Null Mice" ], "prefix" : "10.1006", "volume" : "153", "author" : [ { "given" : "Robert P.", "family" : "Tonge", "affiliation" : [] }, { "given" : "Edward J.", "family" : "Kelly", "affiliation" : [] }, { "given" : "Sam A.", "family" : "Bruschi", "affiliation" : [] }, { "given" : "Tom", "family" : "Kalhorn", "affiliation" : [] }, { "given" : "David L.", "family" : "Eaton", "affiliation" : [] }, { "given" : "Daniel W.", "family" : "Nebert", "affiliation" : [] }, { "given" : "Sidney D.", "family" : "Nelson", "affiliation" : [] } ], "member" : "78", "container-title" : [ "Toxicology and Applied Pharmacology" ], "link" : [ { "URL" : "http://api.elsevier.com/content/article/PII:S0041008X9898543X?httpAccept=text/xml", "content-type" : "text/xml", "content-version" : "vor", "intended-application" : "text-mining" }, { "URL" : "http://api.elsevier.com/content/article/PII:S0041008X9898543X?httpAccept=text/plain", "content-type" : "text/plain", "content-version" : "vor", "intended-application" : "text-mining" } ], "deposited" : { "date-parts" : [ [ 2017, 6, 14 ] ], "date-time" : "2017-06-14T16:51:33Z", "timestamp" : { "$numberLong" : "1497459093000" } }, "score" : 1, "issued" : { "date-parts" : [ [ 1998, 11 ] ] }, "references-count" : 44, "alternative-id" : [ "S0041008X9898543X" ], "URL" : "http://dx.doi.org/10.1006/taap.1998.8543", "ISSN" : [ "0041-008X" ], "issn-type" : [ { "value" : "0041-008X", "type" : "print" } ], "subject" : [ "Toxicology", "Pharmacology" ] } { "_id" : { "$oid" : "5a55170088a035a45bd8490d" }, "indexed" : { "date-parts" : [ [ 2017, 10, 23 ] ], "date-time" : "2017-10-23T14:30:12Z", "timestamp" : { "$numberLong" : "1508769012416" } }, "reference-count" : 37, "publisher" : "Wiley-Blackwell", "issue" : "2", "license" : [ { "URL" : "http://doi.wiley.com/10.1002/tdm_license_1.1", "start" : { "date-parts" : [ [ 2015, 9, 1 ] ], "date-time" : "2015-09-01T00:00:00Z", "timestamp" : { "$numberLong" : "1441065600000" } }, "delay-in-days" : 5356, "content-version" : "tdm" } ], "content-domain" : { "domain" : [], "crossmark-restriction" : false }, "short-container-title" : [ "Am. J. Ind. Med." ], "published-print" : { "date-parts" : [ [ 2001, 2 ] ] }, "DOI" : "10.1002/1097-0274(200102)39:2<218::aid-ajim1009>3.0.co;2-4", "type" : "journal-article", "created" : { "date-parts" : [ [ 2002, 8, 25 ] ], "date-time" : "2002-08-25T20:41:50Z", "timestamp" : { "$numberLong" : "1030308110000" } }, "page" : "218-226", "source" : "Crossref", "is-referenced-by-count" : 10, "title" : [ "The work environment impact assessment: A methodologic framework for evaluating health-based interventions" ], "prefix" : "10.1002", "volume" : "39", "author" : [ { "given" : "Beth J.", "family" : "Rosenberg", "affiliation" : [] }, { "given" : "Elizabeth M.", "family" : "Barbeau", "affiliation" : [] }, { "given" : "Rafael", "family" : "Moure-Eraso", "affiliation" : [] }, { "given" : "Charles", "family" : "Levenstein", "affiliation" : [] } ], "member" : "311", "published-online" : { "date-parts" : [ [ 2001 ] ] }, "reference" : [ { "key" : "BIB1", "author" : "Barbeau", "year" : "1998", "unstructured" : "1998. Displaced tobacco workers, public health, and tobacco policy: moving beyond jobs versus health. Doctoral thesis, Department of Work Environment, University of Massachusetts, Lowell." }, { "key" : "BIB2", "author" : "Berberian", "volume" : "37", "first-page" : "126", "year" : "1987", "journal-title" : "J Occup Environ Med" }, { "key" : "BIB3", "author" : "Bignami", "volume" : "80", "first-page" : "265", "year" : "1981", "journal-title" : "Mutat Res", "DOI" : "10.1016/0027-5107(81)90099-3", "doi-asserted-by" : "crossref" }, { "key" : "BIB4", "author" : "Britton", "year" : "1989", "unstructured" : "1989. The post-Alar era dawns chilly for apple growers. Boston Globe. Oct. 25, p. 34." }, { "key" : "BIB5", "author" : "Brusick", "year" : "1976", "unstructured" : "1976. Mutagen and oncogen Study on 1,1-dimethylhydrazine. Prepared for the Aerospace Med. Res. Lab., Aeropsace Med. Div. Airforce Systems Command, Wright- Patterson A.F.B., Dayton OH Litton Bionetics, Inc., Kensington, MD. NTIS AD-A035475." }, { "key" : "BIB6", "author" : "Chemical Marketing Reporter", "year" : "1984", "unstructured" : "Chemical Marketing Reporter. 1984. Uniroyal pesticide to be reviewed by EPA: regulatory action prompted by its toxicity. July 23." }, { "key" : "BIB7", "author" : "Chemical Marketing Reporter", "year" : "1989", "unstructured" : "Chemical Marketing Reporter. 1989. Uniroyal pulls apple pesticide from market, citing controversy. June 5." }, { "key" : "BIB8", "year" : "1990", "unstructured" : "Du Pont Chemical Company. 1990. MSDS No. M0000057, p. 2." }, { "key" : "BIB9", "year" : "1993", "unstructured" : "Farm Chemicals Handbook '93. 1993. Willoughby, OH: Meister.", "volume-title" : "Farm Chemicals Handbook '93" }, { "key" : "BIB10", "year" : "1985", "unstructured" : "Farm Chemicals Handbook '85. 1985. Willoughby, OH: Meister.", "volume-title" : "Farm Chemicals Handbook '85" }, { "key" : "BIB11", "author" : "Federal Register", "year" : "1989", "unstructured" : "Federal Register. 1989. Daminozide: termination of special review of food uses. Vol. 54, No. 216, p. 47482, November 14." }, { "key" : "BIB12", "author" : "Fenske", "first-page" : "729", "year" : "2000", "unstructured" : "2000. Agricultural workers. In: editors. Occupational health: recognizing and preventing work-related disease and injury. 4th ed. Philadelphia: Lippincott Williams and Wilkins, p. 729-748.", "volume-title" : "Occupational health: recognizing and preventing work-related disease and injury" }, { "key" : "BIB13", "author" : "Gibson", "volume" : "5", "first-page" : "24", "year" : "1994", "journal-title" : "New Solutions", "DOI" : "10.2190/NS5.1.g", "doi-asserted-by" : "crossref" }, { "key" : "BIB14", "author" : "Goldenhar", "volume" : "29", "first-page" : "289", "year" : "1996", "journal-title" : "Am J Ind Med", "DOI" : "10.1002/(SICI)1097-0274(199604)29:4<289::AID-AJIM2>3.0.CO;2-K", "doi-asserted-by" : "crossref" }, { "key" : "BIB15", "author" : "Haun", "year" : "1984", "unstructured" : "1984. Inhalation studies of UDMH. Air Force Aerospace Medical Res Lab, TR-85-020." }, { "key" : "BIB16", "author" : "International Agency for Research on Cancer (IARC)", "year" : "1997", "unstructured" : "International Agency for Research on Cancer (IARC). 1997. Evaluation of carcinogen risks to humans: man-made mineral fibres and radon. Lyons, France." }, { "key" : "BIB17", "author" : "Lord", "year" : "1969", "unstructured" : "1969 (May-June). Thoughts on the apple harvest problem. Fruit Notes. U. S. Department of Agriculture, Massachusetts Extension Service." }, { "key" : "BIB18", "author" : "Manning", "first-page" : "34", "year" : "1989", "unstructured" : "Sales Agent for J. P. Sullivan and Co., of Ayer, MA, an apple commission house. In 1989. The post-Alar era dawns chilly for apple growers. Boston Globe Oct. 25 p. 34.", "volume-title" : "The post-Alar era dawns chilly for apple growers" }, { "key" : "BIB19", "author" : "National Cancer Institute", "year" : "1978", "unstructured" : "National Cancer Institute. 1978. Bioassay of daminozide for possible carcinogenicity. Washington, D.C., United State Department of Health, Education and Welfare, Public Health Service (NIC Carcinogenesis Technical Report Series No. 83; DHEW Publication No (NIH 78-1333)." }, { "key" : "BIB20", "author" : "Rogers", "volume" : "89", "first-page" : "321", "year" : "1981", "journal-title" : "Mutat Res", "DOI" : "10.1016/0165-1218(81)90113-0", "doi-asserted-by" : "crossref" }, { "key" : "BIB21", "author" : "Rosenberg", "year" : "1995", "unstructured" : "1995. The best laid bans: the impact of pesticide bans on workers. Doctoral thesis, Department of Work Environment, University of Massachusetts Lowell." }, { "key" : "BIB22", "author" : "Rosenberg", "volume" : "6", "first-page" : "34", "year" : "1996", "journal-title" : "New Solutions: A Journal of Environmental and Occupational Health Policy", "DOI" : "10.2190/NS6.2.d", "doi-asserted-by" : "crossref" }, { "key" : "BIB23", "author" : "Rosenberg", "volume" : "8", "first-page" : "365", "year" : "1998", "journal-title" : "New Solutions Environmental Health Policy", "DOI" : "10.2190/A2A1-CT1X-RY6D-RR3M", "doi-asserted-by" : "crossref" }, { "key" : "BIB24", "author" : "Saunders", "volume" : "29", "first-page" : "409", "year" : "1987", "journal-title" : "J Occup Environ Med" }, { "key" : "BIB25", "author" : "Toth", "volume" : "50", "first-page" : "181", "year" : "1973", "journal-title" : "J Natl Cancer Inst", "DOI" : "10.1093/jnci/50.1.181", "doi-asserted-by" : "crossref" }, { "key" : "BIB26", "author" : "Toth", "volume" : "40", "first-page" : "2427", "year" : "1977a", "journal-title" : "Cancer", "DOI" : "10.1002/1097-0142(197711)40:5+<2427::AID-CNCR2820400906>3.0.CO;2-Y", "doi-asserted-by" : "crossref" }, { "key" : "BIB27", "author" : "Toth", "volume" : "37", "first-page" : "3497", "year" : "1977b", "journal-title" : "Cancer Res" }, { "key" : "BIB28", "author" : "U.S. Environmental Protection Agency", "year" : "1986", "unstructured" : "U.S. Environmental Protection Agency. 1986. Integrated Risk Information System (IRIS). Oxamyl. December 9." }, { "key" : "BIB29", "author" : "U.S. Environmental Protection Agency", "year" : "1986", "unstructured" : "U.S. Environmental Protection Agency. 1986. Chemical Fact Sheet Number 26: Daminozide. Office of Pesticides and Toxic Substances, Washington, DC. 10-169." }, { "key" : "BIB30", "author" : "U.S. Environmental Protection Agency", "year" : "1989", "unstructured" : "U.S. Environmental Protection Agency, Office of Pesticide Programs, Office of Pesticides and Toxic Substances. 1989. Daminozide special review technical support document: Preliminary determination to cancel the food uses of Daminozide. Washington, DC: May." }, { "key" : "BIB31", "author" : "U.S. Environmental Protection Agency", "volume" : "54", "first-page" : "10", "year" : "1989", "journal-title" : "Fed Regist." }, { "key" : "BIB32", "author" : "U.S. Environmental Protection Agency", "year" : "1990", "unstructured" : "U.S. Environmental Protection Agency. 1990. Integrated Risk Information System (IRIS). Propargite. May 1." }, { "key" : "BIB33", "author" : "U.S. Environmental Protection Agency", "volume" : "57", "first-page" : "10", "year" : "1992", "journal-title" : "Fed. Regist." }, { "key" : "BIB34", "author" : "U.S. Environmental Protection Agency", "year" : "1993", "unstructured" : "U.S. Environmental Protection Agency, Office of Prevention, Pesticides and Toxic Substances. 1993. R.E.D. Facts, Document number EPA-738-F-93-007. September." }, { "key" : "BIB35", "author" : "U.S. Department of Agriculture", "year" : "1993", "journal-title" : "New England Agricultural Statistics" }, { "key" : "BIB36", "author" : "Warren", "year" : "1992", "unstructured" : "1992. Unanticipated consequences of banning a chemical: the case of Alar. Unpublished manuscript, Department of Work Environment, University of Massachusetts Lowell." }, { "key" : "BIB37", "author" : "Wood", "year" : "1990", "unstructured" : "1990. Memo to Poverty Lane, West Lebanon, New Hampshire, to members of the Risk Assessment/Risk Management Work Group, Keystone National Policy Dialogue on Food Safety, Oct. 26, 1990, cited in Rosenberg, B. 1996." } ], "container-title" : [ "American Journal of Industrial Medicine" ], "link" : [ { "URL" : "https://api.wiley.com/onlinelibrary/tdm/v1/articles/10.1002%2F1097-0274(200102)39:2%3C218::AID-AJIM1009%3E3.0.CO;2-4", "content-type" : "unspecified", "content-version" : "vor", "intended-application" : "text-mining" } ], "deposited" : { "date-parts" : [ [ 2017, 8, 4 ] ], "date-time" : "2017-08-04T20:22:16Z", "timestamp" : { "$numberLong" : "1501878136000" } }, "score" : 1, "issued" : { "date-parts" : [ [ 2001 ] ] }, "references-count" : 37, "URL" : "http://dx.doi.org/10.1002/1097-0274(200102)39:2<218::aid-ajim1009>3.0.co;2-4", "relation" : { "cites" : [] }, "ISSN" : [ "0271-3586", "1097-0274" ], "issn-type" : [ { "value" : "0271-3586", "type" : "print" }, { "value" : "1097-0274", "type" : "electronic" } ], "subject" : [ "Public Health, Environmental and Occupational Health" ] } { "_id" : { "$oid" : "5a553b4388a035a45bf39150" }, "indexed" : { "date-parts" : [ [ 2017, 10, 23 ] ], "date-time" : "2017-10-23T17:10:15Z", "timestamp" : { "$numberLong" : "1508778615346" } }, "reference-count" : 22, "publisher" : "Elsevier BV", "issue" : "4", "license" : [ { "URL" : "http://www.elsevier.com/tdm/userlicense/1.0/", "start" : { "date-parts" : [ [ 2001, 12, 1 ] ], "date-time" : "2001-12-01T00:00:00Z", "timestamp" : { "$numberLong" : "1007164800000" } }, "delay-in-days" : 0, "content-version" : "tdm" } ], "content-domain" : { "domain" : [], "crossmark-restriction" : false }, "short-container-title" : [ "International Journal of Hospitality Management" ], "published-print" : { "date-parts" : [ [ 2001, 12 ] ] }, "DOI" : "10.1016/s0278-4319(01)00020-2", "type" : "journal-article", "created" : { "date-parts" : [ [ 2002, 7, 25 ] ], "date-time" : "2002-07-25T14:28:16Z", "timestamp" : { "$numberLong" : "1027607296000" } }, "page" : "325-338", "source" : "Crossref", "is-referenced-by-count" : 14, "title" : [ "Hotel management style: a study of employee perceptions and preferences" ], "prefix" : "10.1016", "volume" : "20", "author" : [ { "given" : "Margaret", "family" : "Deery", "affiliation" : [] }, { "given" : "Leo K", "family" : "Jago", "affiliation" : [] } ], "member" : "78", "container-title" : [ "International Journal of Hospitality Management" ], "link" : [ { "URL" : "http://api.elsevier.com/content/article/PII:S0278431901000202?httpAccept=text/xml", "content-type" : "text/xml", "content-version" : "vor", "intended-application" : "text-mining" }, { "URL" : "http://api.elsevier.com/content/article/PII:S0278431901000202?httpAccept=text/plain", "content-type" : "text/plain", "content-version" : "vor", "intended-application" : "text-mining" } ], "deposited" : { "date-parts" : [ [ 2017, 6, 14 ] ], "date-time" : "2017-06-14T21:24:09Z", "timestamp" : { "$numberLong" : "1497475449000" } }, "score" : 1, "issued" : { "date-parts" : [ [ 2001, 12 ] ] }, "references-count" : 22, "alternative-id" : [ "S0278431901000202" ], "URL" : "http://dx.doi.org/10.1016/s0278-4319(01)00020-2", "ISSN" : [ "0278-4319" ], "issn-type" : [ { "value" : "0278-4319", "type" : "print" } ], "subject" : [ "Tourism, Leisure and Hospitality Management", "Strategy and Management" ] } +{ "_id" : { "$oid" : "5a55176088a035a45bd8802c" }, "indexed" : { "date-parts" : [ [ 2017, 10, 23 ] ], "date-time" : "2017-10-23T14:31:47Z", "timestamp" : { "$numberLong" : "1508769107897" } }, "reference-count" : 1, "publisher" : "Hindawi Limited", "issue" : "2", "license" : [ { "URL" : "http://creativecommons.org/licenses/by/3.0/", "start" : { "date-parts" : [ [ 2002, 1, 1 ] ], "date-time" : "2002-01-01T00:00:00Z", "timestamp" : { "$numberLong" : "1009843200000" } }, "delay-in-days" : 0, "content-version" : "vor" } ], "content-domain" : { "domain" : [], "crossmark-restriction" : false }, "short-container-title" : [ "Comparative and Functional Genomics" ], "published-print" : { "date-parts" : [ [ 2002 ] ] }, "abstract" : "This brief meeting review summarizes the recommendations of NSF and NPGI funded bioinformaticians concerning the future requirements for plant bioinformatics systems and databases.", "DOI" : "10.1002/cfg.158", "type" : "journal-article", "created" : { "date-parts" : [ [ 2002, 8, 25 ] ], "date-time" : "2002-08-25T23:45:33Z", "timestamp" : { "$numberLong" : "1030319133000" } }, "page" : "176-176", "source" : "Crossref", "is-referenced-by-count" : 4, "title" : [ "Meeting Review: Plant Bioinformatics at the NSF and NPGI (PAMGX Satellite) Meetings" ], "prefix" : "10.1155", "volume" : "3", "author" : [ { "ORCID" : "http://orcid.org/0000-0002-4447-597X", "authenticated-orcid" : true, "given" : "Richard", "family" : "Bruskiewich", "affiliation" : [ { "name" : "International Rice Research Institute (IRRI), Metro Manila DAPO 7777, Philippines" } ] } ], "member" : "98", "reference" : [ { "key" : "10.1002/cfg.158-BIB1", "author" : "Brazma", "volume" : "29", "first-page" : "365", "year" : "2001", "journal-title" : "Nature Genetics", "DOI" : "10.1038/ng1201-365", "doi-asserted-by" : "crossref" } ], "container-title" : [ "Comparative and Functional Genomics" ], "link" : [ { "URL" : "http://downloads.hindawi.com/journals/ijg/2002/250628.pdf", "content-type" : "application/pdf", "content-version" : "vor", "intended-application" : "text-mining" }, { "URL" : "http://downloads.hindawi.com/journals/ijg/2002/250628.pdf", "content-type" : "unspecified", "content-version" : "vor", "intended-application" : "similarity-checking" } ], "deposited" : { "date-parts" : [ [ 2017, 8, 5 ] ], "date-time" : "2017-08-05T06:32:00Z", "timestamp" : { "$numberLong" : "1501914720000" } }, "score" : 1, "issued" : { "date-parts" : [ [ 2002 ] ] }, "references-count" : 1, "alternative-id" : [ "250628" ], "URL" : "http://dx.doi.org/10.1002/cfg.158", "relation" : { "cites" : [] }, "ISSN" : [ "1531-6912", "1532-6268" ], "issn-type" : [ { "value" : "1531-6912", "type" : "print" }, { "value" : "1532-6268", "type" : "electronic" } ], "subject" : [ "Biotechnology", "Genetics", "Molecular Biology" ] } { "_id" : { "$oid" : "5a55176088a035a45bd8802c" }, "indexed" : { "date-parts" : [ [ 2017, 10, 23 ] ], "date-time" : "2017-10-23T14:31:47Z", "timestamp" : { "$numberLong" : "1508769107897" } }, "reference-count" : 1, "publisher" : "Hindawi Limited", "issue" : "2", "license" : [ { "URL" : "http://creativecommons.org/licenses/by/3.0/", "start" : { "date-parts" : [ [ 2002, 1, 1 ] ], "date-time" : "2002-01-01T00:00:00Z", "timestamp" : { "$numberLong" : "1009843200000" } }, "delay-in-days" : 0, "content-version" : "vor" } ], "content-domain" : { "domain" : [], "crossmark-restriction" : false }, "short-container-title" : [ "Comparative and Functional Genomics" ], "published-print" : { "date-parts" : [ [ 2002 ] ] }, "abstract" : "This brief meeting review summarizes the recommendations of NSF and NPGI funded bioinformaticians concerning the future requirements for plant bioinformatics systems and databases.", "DOI" : "10.1002/cfg.158", "type" : "journal-article", "created" : { "date-parts" : [ [ 2002, 8, 25 ] ], "date-time" : "2002-08-25T23:45:33Z", "timestamp" : { "$numberLong" : "1030319133000" } }, "page" : "176-176", "source" : "Crossref", "is-referenced-by-count" : 4, "title" : [ "Meeting Review: Plant Bioinformatics at the NSF and NPGI (PAMGX Satellite) Meetings" ], "prefix" : "10.1155", "volume" : "3", "author" : [ { "ORCID" : "http://orcid.org/0000-0002-4447-5978", "authenticated-orcid" : true, "given" : "Richard", "family" : "Bruskiewich", "affiliation" : [ { "name" : "International Rice Research Institute (IRRI), Metro Manila DAPO 7777, Philippines" } ] } ], "member" : "98", "reference" : [ { "key" : "10.1002/cfg.158-BIB1", "author" : "Brazma", "volume" : "29", "first-page" : "365", "year" : "2001", "journal-title" : "Nature Genetics", "DOI" : "10.1038/ng1201-365", "doi-asserted-by" : "crossref" } ], "container-title" : [ "Comparative and Functional Genomics" ], "link" : [ { "URL" : "http://downloads.hindawi.com/journals/ijg/2002/250628.pdf", "content-type" : "application/pdf", "content-version" : "vor", "intended-application" : "text-mining" }, { "URL" : "http://downloads.hindawi.com/journals/ijg/2002/250628.pdf", "content-type" : "unspecified", "content-version" : "vor", "intended-application" : "similarity-checking" } ], "deposited" : { "date-parts" : [ [ 2017, 8, 5 ] ], "date-time" : "2017-08-05T06:32:00Z", "timestamp" : { "$numberLong" : "1501914720000" } }, "score" : 1, "issued" : { "date-parts" : [ [ 2002 ] ] }, "references-count" : 1, "alternative-id" : [ "250628" ], "URL" : "http://dx.doi.org/10.1002/cfg.158", "relation" : { "cites" : [] }, "ISSN" : [ "1531-6912", "1532-6268" ], "issn-type" : [ { "value" : "1531-6912", "type" : "print" }, { "value" : "1532-6268", "type" : "electronic" } ], "subject" : [ "Biotechnology", "Genetics", "Molecular Biology" ] } { "_id" : { "$oid" : "5a551fbe88a035a45bdf19fd" }, "indexed" : { "date-parts" : [ [ 2017, 10, 23 ] ], "date-time" : "2017-10-23T15:12:12Z", "timestamp" : { "$numberLong" : "1508771532055" } }, "reference-count" : 0, "publisher" : "Springer Nature", "issue" : "11", "content-domain" : { "domain" : [], "crossmark-restriction" : false }, "short-container-title" : [ "Skeletal Radiol" ], "published-print" : { "date-parts" : [ [ 2001, 11 ] ] }, "DOI" : "10.1007/s002560100423", "type" : "journal-article", "created" : { "date-parts" : [ [ 2002, 10, 6 ] ], "date-time" : "2002-10-06T13:44:04Z", "timestamp" : { "$numberLong" : "1033911844000" } }, "page" : "643-647", "source" : "Crossref", "is-referenced-by-count" : 2, "title" : [ "Unilateral osteonecrosis in a patient with bilateral os centrale carpi: imaging findings" ], "prefix" : "10.1007", "volume" : "30", "author" : [ { "given" : "F.", "family" : "Abascal", "affiliation" : [] }, { "given" : "L.", "family" : "Cerezal", "affiliation" : [] }, { "given" : "F.", "family" : "del Piñal", "affiliation" : [] }, { "given" : "R.", "family" : "García-Valtuille", "affiliation" : [] }, { "given" : "A.", "family" : "García-Valtuille", "affiliation" : [] }, { "given" : "A.", "family" : "Canga", "affiliation" : [] }, { "given" : "J.", "family" : "Torcida", "affiliation" : [] } ], "member" : "297", "published-online" : { "date-parts" : [ [ 2001, 9, 14 ] ] }, "container-title" : [ "Skeletal Radiology" ], "link" : [ { "URL" : "http://link.springer.com/content/pdf/10.1007/s002560100423", "content-type" : "unspecified", "content-version" : "vor", "intended-application" : "similarity-checking" } ], "deposited" : { "date-parts" : [ [ 2014, 4, 9 ] ], "date-time" : "2014-04-09T05:21:52Z", "timestamp" : { "$numberLong" : "1397020912000" } }, "score" : 1, "issued" : { "date-parts" : [ [ 2001, 9, 14 ] ] }, "references-count" : 0, "alternative-id" : [ "423" ], "URL" : "http://dx.doi.org/10.1007/s002560100423", "ISSN" : [ "0364-2348", "1432-2161" ], "issn-type" : [ { "value" : "0364-2348", "type" : "print" }, { "value" : "1432-2161", "type" : "electronic" } ], "subject" : [ "Radiology Nuclear Medicine and imaging" ] } diff --git a/python/tests/importer.py b/python/tests/importer.py index 190acbed..4d49e794 100644 --- a/python/tests/importer.py +++ b/python/tests/importer.py @@ -13,3 +13,23 @@ def test_issnl_mapping_lookup(): assert fi.issn2issnl('9999-0027') == None assert fi.lookup_issnl('9999-9999') == None + +def test_identifiers(): + + with open('tests/files/ISSN-to-ISSN-L.snip.txt', 'r') as issn_file: + fi = FatcatImporter("http://localhost:9411/v0", issn_file) + + assert fi.is_issnl("1234-5678") == True + assert fi.is_issnl("1234-5678.") == False + assert fi.is_issnl("12345678") == False + assert fi.is_issnl("1-2345678") == False + + assert fi.is_doi("10.1234/56789") == True + assert fi.is_doi("101234/56789") == False + assert fi.is_doi("10.1234_56789") == False + + assert fi.is_orcid("0000-0003-3118-6591") == True + assert fi.is_orcid("0000-00x3-3118-659") == False + assert fi.is_orcid("0000-00033118-659") == False + assert fi.is_orcid("0000-0003-3118-659.") == False + diff --git a/python/tests/orcid.py b/python/tests/orcid.py index 00748972..e07583ac 100644 --- a/python/tests/orcid.py +++ b/python/tests/orcid.py @@ -13,6 +13,10 @@ def test_orcid_importer_batch(orcid_importer): with open('tests/files/0000-0001-8254-7103.json', 'r') as f: orcid_importer.process_batch(f) +def test_orcid_importer_badid(orcid_importer): + with open('tests/files/0000-0001-8254-710X.json', 'r') as f: + orcid_importer.process_batch(f) + def test_orcid_importer(orcid_importer): with open('tests/files/0000-0001-8254-7103.json', 'r') as f: orcid_importer.process_source(f) -- cgit v1.2.3 From 7354899493f6448bed5698ad6ade1dbebcf39379 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 7 Sep 2018 22:37:09 -0700 Subject: TODO and comment --- python/README_codegen.md | 10 + python/fatcat_client/api/default_api.py | 1948 ++++++++++++++++++------ python/tests/codegen_tests/test_default_api.py | 60 + rust/TODO | 2 + rust/src/api_server.rs | 1 - 5 files changed, 1561 insertions(+), 460 deletions(-) (limited to 'python/tests') diff --git a/python/README_codegen.md b/python/README_codegen.md index 393fae32..0d072dde 100644 --- a/python/README_codegen.md +++ b/python/README_codegen.md @@ -80,6 +80,11 @@ Class | Method | HTTP request | Description *DefaultApi* | [**create_release_batch**](docs/DefaultApi.md#create_release_batch) | **POST** /release/batch | *DefaultApi* | [**create_work**](docs/DefaultApi.md#create_work) | **POST** /work | *DefaultApi* | [**create_work_batch**](docs/DefaultApi.md#create_work_batch) | **POST** /work/batch | +*DefaultApi* | [**delete_container**](docs/DefaultApi.md#delete_container) | **DELETE** /container/{id} | +*DefaultApi* | [**delete_creator**](docs/DefaultApi.md#delete_creator) | **DELETE** /creator/{id} | +*DefaultApi* | [**delete_file**](docs/DefaultApi.md#delete_file) | **DELETE** /file/{id} | +*DefaultApi* | [**delete_release**](docs/DefaultApi.md#delete_release) | **DELETE** /release/{id} | +*DefaultApi* | [**delete_work**](docs/DefaultApi.md#delete_work) | **DELETE** /work/{id} | *DefaultApi* | [**get_changelog**](docs/DefaultApi.md#get_changelog) | **GET** /changelog | *DefaultApi* | [**get_changelog_entry**](docs/DefaultApi.md#get_changelog_entry) | **GET** /changelog/{id} | *DefaultApi* | [**get_container**](docs/DefaultApi.md#get_container) | **GET** /container/{id} | @@ -103,6 +108,11 @@ Class | Method | HTTP request | Description *DefaultApi* | [**lookup_creator**](docs/DefaultApi.md#lookup_creator) | **GET** /creator/lookup | *DefaultApi* | [**lookup_file**](docs/DefaultApi.md#lookup_file) | **GET** /file/lookup | *DefaultApi* | [**lookup_release**](docs/DefaultApi.md#lookup_release) | **GET** /release/lookup | +*DefaultApi* | [**update_container**](docs/DefaultApi.md#update_container) | **PUT** /container/{id} | +*DefaultApi* | [**update_creator**](docs/DefaultApi.md#update_creator) | **PUT** /creator/{id} | +*DefaultApi* | [**update_file**](docs/DefaultApi.md#update_file) | **PUT** /file/{id} | +*DefaultApi* | [**update_release**](docs/DefaultApi.md#update_release) | **PUT** /release/{id} | +*DefaultApi* | [**update_work**](docs/DefaultApi.md#update_work) | **PUT** /work/{id} | ## Documentation For Models diff --git a/python/fatcat_client/api/default_api.py b/python/fatcat_client/api/default_api.py index a0298750..23c8d7ca 100644 --- a/python/fatcat_client/api/default_api.py +++ b/python/fatcat_client/api/default_api.py @@ -1245,43 +1245,45 @@ class DefaultApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def get_changelog(self, **kwargs): # noqa: E501 - """get_changelog # noqa: E501 + def delete_container(self, id, **kwargs): # noqa: E501 + """delete_container # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_changelog(async=True) + >>> thread = api.delete_container(id, async=True) >>> result = thread.get() :param async bool - :param int limit: - :return: list[ChangelogEntry] + :param str id: (required) + :param str editgroup: + :return: EntityEdit If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.get_changelog_with_http_info(**kwargs) # noqa: E501 + return self.delete_container_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.get_changelog_with_http_info(**kwargs) # noqa: E501 + (data) = self.delete_container_with_http_info(id, **kwargs) # noqa: E501 return data - def get_changelog_with_http_info(self, **kwargs): # noqa: E501 - """get_changelog # noqa: E501 + def delete_container_with_http_info(self, id, **kwargs): # noqa: E501 + """delete_container # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_changelog_with_http_info(async=True) + >>> thread = api.delete_container_with_http_info(id, async=True) >>> result = thread.get() :param async bool - :param int limit: - :return: list[ChangelogEntry] + :param str id: (required) + :param str editgroup: + :return: EntityEdit If the method is called asynchronously, returns the request thread. """ - all_params = ['limit'] # noqa: E501 + all_params = ['id', 'editgroup'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1292,18 +1294,24 @@ class DefaultApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method get_changelog" % key + " to method delete_container" % key ) params[key] = val del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `delete_container`") # noqa: E501 collection_formats = {} path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 + if 'editgroup' in params: + query_params.append(('editgroup', params['editgroup'])) # noqa: E501 header_params = {} @@ -1323,14 +1331,14 @@ class DefaultApi(object): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/changelog', 'GET', + '/container/{id}', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[ChangelogEntry]', # noqa: E501 + response_type='EntityEdit', # noqa: E501 auth_settings=auth_settings, async=params.get('async'), _return_http_data_only=params.get('_return_http_data_only'), @@ -1338,43 +1346,45 @@ class DefaultApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def get_changelog_entry(self, id, **kwargs): # noqa: E501 - """get_changelog_entry # noqa: E501 + def delete_creator(self, id, **kwargs): # noqa: E501 + """delete_creator # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_changelog_entry(id, async=True) + >>> thread = api.delete_creator(id, async=True) >>> result = thread.get() :param async bool - :param int id: (required) - :return: ChangelogEntry + :param str id: (required) + :param str editgroup: + :return: EntityEdit If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.get_changelog_entry_with_http_info(id, **kwargs) # noqa: E501 + return self.delete_creator_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.get_changelog_entry_with_http_info(id, **kwargs) # noqa: E501 + (data) = self.delete_creator_with_http_info(id, **kwargs) # noqa: E501 return data - def get_changelog_entry_with_http_info(self, id, **kwargs): # noqa: E501 - """get_changelog_entry # noqa: E501 + def delete_creator_with_http_info(self, id, **kwargs): # noqa: E501 + """delete_creator # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_changelog_entry_with_http_info(id, async=True) + >>> thread = api.delete_creator_with_http_info(id, async=True) >>> result = thread.get() :param async bool - :param int id: (required) - :return: ChangelogEntry + :param str id: (required) + :param str editgroup: + :return: EntityEdit If the method is called asynchronously, returns the request thread. """ - all_params = ['id'] # noqa: E501 + all_params = ['id', 'editgroup'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1385,14 +1395,14 @@ class DefaultApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method get_changelog_entry" % key + " to method delete_creator" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `get_changelog_entry`") # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `delete_creator`") # noqa: E501 collection_formats = {} @@ -1401,6 +1411,8 @@ class DefaultApi(object): path_params['id'] = params['id'] # noqa: E501 query_params = [] + if 'editgroup' in params: + query_params.append(('editgroup', params['editgroup'])) # noqa: E501 header_params = {} @@ -1420,14 +1432,14 @@ class DefaultApi(object): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/changelog/{id}', 'GET', + '/creator/{id}', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='ChangelogEntry', # noqa: E501 + response_type='EntityEdit', # noqa: E501 auth_settings=auth_settings, async=params.get('async'), _return_http_data_only=params.get('_return_http_data_only'), @@ -1435,45 +1447,45 @@ class DefaultApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def get_container(self, id, **kwargs): # noqa: E501 - """get_container # noqa: E501 + def delete_file(self, id, **kwargs): # noqa: E501 + """delete_file # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_container(id, async=True) + >>> thread = api.delete_file(id, async=True) >>> result = thread.get() :param async bool :param str id: (required) - :param str expand: List of sub-entities to expand in response. For now, only 'all' accepted. - :return: ContainerEntity + :param str editgroup: + :return: EntityEdit If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.get_container_with_http_info(id, **kwargs) # noqa: E501 + return self.delete_file_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.get_container_with_http_info(id, **kwargs) # noqa: E501 + (data) = self.delete_file_with_http_info(id, **kwargs) # noqa: E501 return data - def get_container_with_http_info(self, id, **kwargs): # noqa: E501 - """get_container # noqa: E501 + def delete_file_with_http_info(self, id, **kwargs): # noqa: E501 + """delete_file # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_container_with_http_info(id, async=True) + >>> thread = api.delete_file_with_http_info(id, async=True) >>> result = thread.get() :param async bool :param str id: (required) - :param str expand: List of sub-entities to expand in response. For now, only 'all' accepted. - :return: ContainerEntity + :param str editgroup: + :return: EntityEdit If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'expand'] # noqa: E501 + all_params = ['id', 'editgroup'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1484,14 +1496,14 @@ class DefaultApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method get_container" % key + " to method delete_file" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `get_container`") # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `delete_file`") # noqa: E501 collection_formats = {} @@ -1500,8 +1512,8 @@ class DefaultApi(object): path_params['id'] = params['id'] # noqa: E501 query_params = [] - if 'expand' in params: - query_params.append(('expand', params['expand'])) # noqa: E501 + if 'editgroup' in params: + query_params.append(('editgroup', params['editgroup'])) # noqa: E501 header_params = {} @@ -1521,14 +1533,14 @@ class DefaultApi(object): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/container/{id}', 'GET', + '/file/{id}', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='ContainerEntity', # noqa: E501 + response_type='EntityEdit', # noqa: E501 auth_settings=auth_settings, async=params.get('async'), _return_http_data_only=params.get('_return_http_data_only'), @@ -1536,45 +1548,45 @@ class DefaultApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def get_container_history(self, id, **kwargs): # noqa: E501 - """get_container_history # noqa: E501 + def delete_release(self, id, **kwargs): # noqa: E501 + """delete_release # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_container_history(id, async=True) + >>> thread = api.delete_release(id, async=True) >>> result = thread.get() :param async bool :param str id: (required) - :param int limit: - :return: list[EntityHistoryEntry] + :param str editgroup: + :return: EntityEdit If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.get_container_history_with_http_info(id, **kwargs) # noqa: E501 + return self.delete_release_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.get_container_history_with_http_info(id, **kwargs) # noqa: E501 + (data) = self.delete_release_with_http_info(id, **kwargs) # noqa: E501 return data - def get_container_history_with_http_info(self, id, **kwargs): # noqa: E501 - """get_container_history # noqa: E501 + def delete_release_with_http_info(self, id, **kwargs): # noqa: E501 + """delete_release # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_container_history_with_http_info(id, async=True) + >>> thread = api.delete_release_with_http_info(id, async=True) >>> result = thread.get() :param async bool :param str id: (required) - :param int limit: - :return: list[EntityHistoryEntry] + :param str editgroup: + :return: EntityEdit If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'limit'] # noqa: E501 + all_params = ['id', 'editgroup'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1585,14 +1597,14 @@ class DefaultApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method get_container_history" % key + " to method delete_release" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `get_container_history`") # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `delete_release`") # noqa: E501 collection_formats = {} @@ -1601,8 +1613,8 @@ class DefaultApi(object): path_params['id'] = params['id'] # noqa: E501 query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 + if 'editgroup' in params: + query_params.append(('editgroup', params['editgroup'])) # noqa: E501 header_params = {} @@ -1622,14 +1634,14 @@ class DefaultApi(object): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/container/{id}/history', 'GET', + '/release/{id}', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[EntityHistoryEntry]', # noqa: E501 + response_type='EntityEdit', # noqa: E501 auth_settings=auth_settings, async=params.get('async'), _return_http_data_only=params.get('_return_http_data_only'), @@ -1637,45 +1649,45 @@ class DefaultApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def get_creator(self, id, **kwargs): # noqa: E501 - """get_creator # noqa: E501 + def delete_work(self, id, **kwargs): # noqa: E501 + """delete_work # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_creator(id, async=True) + >>> thread = api.delete_work(id, async=True) >>> result = thread.get() :param async bool :param str id: (required) - :param str expand: List of sub-entities to expand in response. For now, only 'all' accepted. - :return: CreatorEntity + :param str editgroup: + :return: EntityEdit If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.get_creator_with_http_info(id, **kwargs) # noqa: E501 + return self.delete_work_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.get_creator_with_http_info(id, **kwargs) # noqa: E501 + (data) = self.delete_work_with_http_info(id, **kwargs) # noqa: E501 return data - def get_creator_with_http_info(self, id, **kwargs): # noqa: E501 - """get_creator # noqa: E501 + def delete_work_with_http_info(self, id, **kwargs): # noqa: E501 + """delete_work # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_creator_with_http_info(id, async=True) + >>> thread = api.delete_work_with_http_info(id, async=True) >>> result = thread.get() :param async bool :param str id: (required) - :param str expand: List of sub-entities to expand in response. For now, only 'all' accepted. - :return: CreatorEntity + :param str editgroup: + :return: EntityEdit If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'expand'] # noqa: E501 + all_params = ['id', 'editgroup'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1686,14 +1698,14 @@ class DefaultApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method get_creator" % key + " to method delete_work" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `get_creator`") # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `delete_work`") # noqa: E501 collection_formats = {} @@ -1702,8 +1714,8 @@ class DefaultApi(object): path_params['id'] = params['id'] # noqa: E501 query_params = [] - if 'expand' in params: - query_params.append(('expand', params['expand'])) # noqa: E501 + if 'editgroup' in params: + query_params.append(('editgroup', params['editgroup'])) # noqa: E501 header_params = {} @@ -1723,14 +1735,14 @@ class DefaultApi(object): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/creator/{id}', 'GET', + '/work/{id}', 'DELETE', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='CreatorEntity', # noqa: E501 + response_type='EntityEdit', # noqa: E501 auth_settings=auth_settings, async=params.get('async'), _return_http_data_only=params.get('_return_http_data_only'), @@ -1738,45 +1750,43 @@ class DefaultApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def get_creator_history(self, id, **kwargs): # noqa: E501 - """get_creator_history # noqa: E501 + def get_changelog(self, **kwargs): # noqa: E501 + """get_changelog # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_creator_history(id, async=True) + >>> thread = api.get_changelog(async=True) >>> result = thread.get() :param async bool - :param str id: (required) :param int limit: - :return: list[EntityHistoryEntry] + :return: list[ChangelogEntry] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.get_creator_history_with_http_info(id, **kwargs) # noqa: E501 + return self.get_changelog_with_http_info(**kwargs) # noqa: E501 else: - (data) = self.get_creator_history_with_http_info(id, **kwargs) # noqa: E501 + (data) = self.get_changelog_with_http_info(**kwargs) # noqa: E501 return data - def get_creator_history_with_http_info(self, id, **kwargs): # noqa: E501 - """get_creator_history # noqa: E501 + def get_changelog_with_http_info(self, **kwargs): # noqa: E501 + """get_changelog # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_creator_history_with_http_info(id, async=True) + >>> thread = api.get_changelog_with_http_info(async=True) >>> result = thread.get() :param async bool - :param str id: (required) :param int limit: - :return: list[EntityHistoryEntry] + :return: list[ChangelogEntry] If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'limit'] # noqa: E501 + all_params = ['limit'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1787,20 +1797,14 @@ class DefaultApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method get_creator_history" % key + " to method get_changelog" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'id' is set - if ('id' not in params or - params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `get_creator_history`") # noqa: E501 collection_formats = {} path_params = {} - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 query_params = [] if 'limit' in params: @@ -1824,14 +1828,14 @@ class DefaultApi(object): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/creator/{id}/history', 'GET', + '/changelog', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[EntityHistoryEntry]', # noqa: E501 + response_type='list[ChangelogEntry]', # noqa: E501 auth_settings=auth_settings, async=params.get('async'), _return_http_data_only=params.get('_return_http_data_only'), @@ -1839,38 +1843,38 @@ class DefaultApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def get_creator_releases(self, id, **kwargs): # noqa: E501 - """get_creator_releases # noqa: E501 + def get_changelog_entry(self, id, **kwargs): # noqa: E501 + """get_changelog_entry # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_creator_releases(id, async=True) + >>> thread = api.get_changelog_entry(id, async=True) >>> result = thread.get() :param async bool - :param str id: (required) - :return: list[ReleaseEntity] + :param int id: (required) + :return: ChangelogEntry If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.get_creator_releases_with_http_info(id, **kwargs) # noqa: E501 + return self.get_changelog_entry_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.get_creator_releases_with_http_info(id, **kwargs) # noqa: E501 + (data) = self.get_changelog_entry_with_http_info(id, **kwargs) # noqa: E501 return data - def get_creator_releases_with_http_info(self, id, **kwargs): # noqa: E501 - """get_creator_releases # noqa: E501 + def get_changelog_entry_with_http_info(self, id, **kwargs): # noqa: E501 + """get_changelog_entry # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_creator_releases_with_http_info(id, async=True) + >>> thread = api.get_changelog_entry_with_http_info(id, async=True) >>> result = thread.get() :param async bool - :param str id: (required) - :return: list[ReleaseEntity] + :param int id: (required) + :return: ChangelogEntry If the method is called asynchronously, returns the request thread. """ @@ -1886,14 +1890,14 @@ class DefaultApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method get_creator_releases" % key + " to method get_changelog_entry" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `get_creator_releases`") # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `get_changelog_entry`") # noqa: E501 collection_formats = {} @@ -1921,14 +1925,14 @@ class DefaultApi(object): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/creator/{id}/releases', 'GET', + '/changelog/{id}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[ReleaseEntity]', # noqa: E501 + response_type='ChangelogEntry', # noqa: E501 auth_settings=auth_settings, async=params.get('async'), _return_http_data_only=params.get('_return_http_data_only'), @@ -1936,43 +1940,45 @@ class DefaultApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def get_editgroup(self, id, **kwargs): # noqa: E501 - """get_editgroup # noqa: E501 + def get_container(self, id, **kwargs): # noqa: E501 + """get_container # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_editgroup(id, async=True) + >>> thread = api.get_container(id, async=True) >>> result = thread.get() :param async bool - :param str id: base32-encoded unique identifier (required) - :return: Editgroup + :param str id: (required) + :param str expand: List of sub-entities to expand in response. For now, only 'all' accepted. + :return: ContainerEntity If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.get_editgroup_with_http_info(id, **kwargs) # noqa: E501 + return self.get_container_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.get_editgroup_with_http_info(id, **kwargs) # noqa: E501 + (data) = self.get_container_with_http_info(id, **kwargs) # noqa: E501 return data - def get_editgroup_with_http_info(self, id, **kwargs): # noqa: E501 - """get_editgroup # noqa: E501 + def get_container_with_http_info(self, id, **kwargs): # noqa: E501 + """get_container # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_editgroup_with_http_info(id, async=True) + >>> thread = api.get_container_with_http_info(id, async=True) >>> result = thread.get() :param async bool - :param str id: base32-encoded unique identifier (required) - :return: Editgroup + :param str id: (required) + :param str expand: List of sub-entities to expand in response. For now, only 'all' accepted. + :return: ContainerEntity If the method is called asynchronously, returns the request thread. """ - all_params = ['id'] # noqa: E501 + all_params = ['id', 'expand'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -1983,23 +1989,15 @@ class DefaultApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method get_editgroup" % key + " to method get_container" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `get_editgroup`") # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `get_container`") # noqa: E501 - if ('id' in params and - len(params['id']) > 26): - raise ValueError("Invalid value for parameter `id` when calling `get_editgroup`, length must be less than or equal to `26`") # noqa: E501 - if ('id' in params and - len(params['id']) < 26): - raise ValueError("Invalid value for parameter `id` when calling `get_editgroup`, length must be greater than or equal to `26`") # noqa: E501 - if 'id' in params and not re.search('[a-zA-Z2-7]{26}', params['id']): # noqa: E501 - raise ValueError("Invalid value for parameter `id` when calling `get_editgroup`, must conform to the pattern `/[a-zA-Z2-7]{26}/`") # noqa: E501 collection_formats = {} path_params = {} @@ -2007,6 +2005,8 @@ class DefaultApi(object): path_params['id'] = params['id'] # noqa: E501 query_params = [] + if 'expand' in params: + query_params.append(('expand', params['expand'])) # noqa: E501 header_params = {} @@ -2026,14 +2026,14 @@ class DefaultApi(object): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/editgroup/{id}', 'GET', + '/container/{id}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='Editgroup', # noqa: E501 + response_type='ContainerEntity', # noqa: E501 auth_settings=auth_settings, async=params.get('async'), _return_http_data_only=params.get('_return_http_data_only'), @@ -2041,43 +2041,45 @@ class DefaultApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def get_editor(self, id, **kwargs): # noqa: E501 - """get_editor # noqa: E501 + def get_container_history(self, id, **kwargs): # noqa: E501 + """get_container_history # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_editor(id, async=True) + >>> thread = api.get_container_history(id, async=True) >>> result = thread.get() :param async bool :param str id: (required) - :return: Editor + :param int limit: + :return: list[EntityHistoryEntry] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.get_editor_with_http_info(id, **kwargs) # noqa: E501 + return self.get_container_history_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.get_editor_with_http_info(id, **kwargs) # noqa: E501 + (data) = self.get_container_history_with_http_info(id, **kwargs) # noqa: E501 return data - def get_editor_with_http_info(self, id, **kwargs): # noqa: E501 - """get_editor # noqa: E501 - + def get_container_history_with_http_info(self, id, **kwargs): # noqa: E501 + """get_container_history # noqa: E501 + This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_editor_with_http_info(id, async=True) + >>> thread = api.get_container_history_with_http_info(id, async=True) >>> result = thread.get() :param async bool :param str id: (required) - :return: Editor + :param int limit: + :return: list[EntityHistoryEntry] If the method is called asynchronously, returns the request thread. """ - all_params = ['id'] # noqa: E501 + all_params = ['id', 'limit'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -2088,14 +2090,14 @@ class DefaultApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method get_editor" % key + " to method get_container_history" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `get_editor`") # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `get_container_history`") # noqa: E501 collection_formats = {} @@ -2104,6 +2106,8 @@ class DefaultApi(object): path_params['id'] = params['id'] # noqa: E501 query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} @@ -2123,14 +2127,14 @@ class DefaultApi(object): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/editor/{id}', 'GET', + '/container/{id}/history', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='Editor', # noqa: E501 + response_type='list[EntityHistoryEntry]', # noqa: E501 auth_settings=auth_settings, async=params.get('async'), _return_http_data_only=params.get('_return_http_data_only'), @@ -2138,43 +2142,45 @@ class DefaultApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def get_editor_changelog(self, id, **kwargs): # noqa: E501 - """get_editor_changelog # noqa: E501 + def get_creator(self, id, **kwargs): # noqa: E501 + """get_creator # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_editor_changelog(id, async=True) + >>> thread = api.get_creator(id, async=True) >>> result = thread.get() :param async bool :param str id: (required) - :return: list[ChangelogEntry] + :param str expand: List of sub-entities to expand in response. For now, only 'all' accepted. + :return: CreatorEntity If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.get_editor_changelog_with_http_info(id, **kwargs) # noqa: E501 + return self.get_creator_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.get_editor_changelog_with_http_info(id, **kwargs) # noqa: E501 + (data) = self.get_creator_with_http_info(id, **kwargs) # noqa: E501 return data - def get_editor_changelog_with_http_info(self, id, **kwargs): # noqa: E501 - """get_editor_changelog # noqa: E501 + def get_creator_with_http_info(self, id, **kwargs): # noqa: E501 + """get_creator # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_editor_changelog_with_http_info(id, async=True) + >>> thread = api.get_creator_with_http_info(id, async=True) >>> result = thread.get() :param async bool :param str id: (required) - :return: list[ChangelogEntry] + :param str expand: List of sub-entities to expand in response. For now, only 'all' accepted. + :return: CreatorEntity If the method is called asynchronously, returns the request thread. """ - all_params = ['id'] # noqa: E501 + all_params = ['id', 'expand'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -2185,14 +2191,14 @@ class DefaultApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method get_editor_changelog" % key + " to method get_creator" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `get_editor_changelog`") # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `get_creator`") # noqa: E501 collection_formats = {} @@ -2201,6 +2207,8 @@ class DefaultApi(object): path_params['id'] = params['id'] # noqa: E501 query_params = [] + if 'expand' in params: + query_params.append(('expand', params['expand'])) # noqa: E501 header_params = {} @@ -2220,14 +2228,14 @@ class DefaultApi(object): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/editor/{id}/changelog', 'GET', + '/creator/{id}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[ChangelogEntry]', # noqa: E501 + response_type='CreatorEntity', # noqa: E501 auth_settings=auth_settings, async=params.get('async'), _return_http_data_only=params.get('_return_http_data_only'), @@ -2235,45 +2243,45 @@ class DefaultApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def get_file(self, id, **kwargs): # noqa: E501 - """get_file # noqa: E501 + def get_creator_history(self, id, **kwargs): # noqa: E501 + """get_creator_history # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_file(id, async=True) + >>> thread = api.get_creator_history(id, async=True) >>> result = thread.get() :param async bool :param str id: (required) - :param str expand: List of sub-entities to expand in response. For now, only 'all' accepted. - :return: FileEntity + :param int limit: + :return: list[EntityHistoryEntry] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.get_file_with_http_info(id, **kwargs) # noqa: E501 + return self.get_creator_history_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.get_file_with_http_info(id, **kwargs) # noqa: E501 + (data) = self.get_creator_history_with_http_info(id, **kwargs) # noqa: E501 return data - def get_file_with_http_info(self, id, **kwargs): # noqa: E501 - """get_file # noqa: E501 + def get_creator_history_with_http_info(self, id, **kwargs): # noqa: E501 + """get_creator_history # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_file_with_http_info(id, async=True) + >>> thread = api.get_creator_history_with_http_info(id, async=True) >>> result = thread.get() :param async bool :param str id: (required) - :param str expand: List of sub-entities to expand in response. For now, only 'all' accepted. - :return: FileEntity + :param int limit: + :return: list[EntityHistoryEntry] If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'expand'] # noqa: E501 + all_params = ['id', 'limit'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -2284,14 +2292,14 @@ class DefaultApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method get_file" % key + " to method get_creator_history" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `get_file`") # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `get_creator_history`") # noqa: E501 collection_formats = {} @@ -2300,8 +2308,8 @@ class DefaultApi(object): path_params['id'] = params['id'] # noqa: E501 query_params = [] - if 'expand' in params: - query_params.append(('expand', params['expand'])) # noqa: E501 + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} @@ -2321,14 +2329,14 @@ class DefaultApi(object): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/file/{id}', 'GET', + '/creator/{id}/history', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='FileEntity', # noqa: E501 + response_type='list[EntityHistoryEntry]', # noqa: E501 auth_settings=auth_settings, async=params.get('async'), _return_http_data_only=params.get('_return_http_data_only'), @@ -2336,45 +2344,43 @@ class DefaultApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def get_file_history(self, id, **kwargs): # noqa: E501 - """get_file_history # noqa: E501 + def get_creator_releases(self, id, **kwargs): # noqa: E501 + """get_creator_releases # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_file_history(id, async=True) + >>> thread = api.get_creator_releases(id, async=True) >>> result = thread.get() :param async bool :param str id: (required) - :param int limit: - :return: list[EntityHistoryEntry] + :return: list[ReleaseEntity] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.get_file_history_with_http_info(id, **kwargs) # noqa: E501 + return self.get_creator_releases_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.get_file_history_with_http_info(id, **kwargs) # noqa: E501 + (data) = self.get_creator_releases_with_http_info(id, **kwargs) # noqa: E501 return data - def get_file_history_with_http_info(self, id, **kwargs): # noqa: E501 - """get_file_history # noqa: E501 + def get_creator_releases_with_http_info(self, id, **kwargs): # noqa: E501 + """get_creator_releases # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_file_history_with_http_info(id, async=True) + >>> thread = api.get_creator_releases_with_http_info(id, async=True) >>> result = thread.get() :param async bool :param str id: (required) - :param int limit: - :return: list[EntityHistoryEntry] + :return: list[ReleaseEntity] If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'limit'] # noqa: E501 + all_params = ['id'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -2385,14 +2391,14 @@ class DefaultApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method get_file_history" % key + " to method get_creator_releases" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `get_file_history`") # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `get_creator_releases`") # noqa: E501 collection_formats = {} @@ -2401,8 +2407,6 @@ class DefaultApi(object): path_params['id'] = params['id'] # noqa: E501 query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} @@ -2422,14 +2426,14 @@ class DefaultApi(object): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/file/{id}/history', 'GET', + '/creator/{id}/releases', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[EntityHistoryEntry]', # noqa: E501 + response_type='list[ReleaseEntity]', # noqa: E501 auth_settings=auth_settings, async=params.get('async'), _return_http_data_only=params.get('_return_http_data_only'), @@ -2437,45 +2441,43 @@ class DefaultApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def get_release(self, id, **kwargs): # noqa: E501 - """get_release # noqa: E501 + def get_editgroup(self, id, **kwargs): # noqa: E501 + """get_editgroup # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_release(id, async=True) + >>> thread = api.get_editgroup(id, async=True) >>> result = thread.get() :param async bool - :param str id: (required) - :param str expand: List of sub-entities to expand in response. For now, only 'all' accepted. - :return: ReleaseEntity + :param str id: base32-encoded unique identifier (required) + :return: Editgroup If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.get_release_with_http_info(id, **kwargs) # noqa: E501 + return self.get_editgroup_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.get_release_with_http_info(id, **kwargs) # noqa: E501 + (data) = self.get_editgroup_with_http_info(id, **kwargs) # noqa: E501 return data - def get_release_with_http_info(self, id, **kwargs): # noqa: E501 - """get_release # noqa: E501 + def get_editgroup_with_http_info(self, id, **kwargs): # noqa: E501 + """get_editgroup # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_release_with_http_info(id, async=True) + >>> thread = api.get_editgroup_with_http_info(id, async=True) >>> result = thread.get() :param async bool - :param str id: (required) - :param str expand: List of sub-entities to expand in response. For now, only 'all' accepted. - :return: ReleaseEntity + :param str id: base32-encoded unique identifier (required) + :return: Editgroup If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'expand'] # noqa: E501 + all_params = ['id'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -2486,15 +2488,23 @@ class DefaultApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method get_release" % key + " to method get_editgroup" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `get_release`") # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `get_editgroup`") # noqa: E501 + if ('id' in params and + len(params['id']) > 26): + raise ValueError("Invalid value for parameter `id` when calling `get_editgroup`, length must be less than or equal to `26`") # noqa: E501 + if ('id' in params and + len(params['id']) < 26): + raise ValueError("Invalid value for parameter `id` when calling `get_editgroup`, length must be greater than or equal to `26`") # noqa: E501 + if 'id' in params and not re.search('[a-zA-Z2-7]{26}', params['id']): # noqa: E501 + raise ValueError("Invalid value for parameter `id` when calling `get_editgroup`, must conform to the pattern `/[a-zA-Z2-7]{26}/`") # noqa: E501 collection_formats = {} path_params = {} @@ -2502,8 +2512,6 @@ class DefaultApi(object): path_params['id'] = params['id'] # noqa: E501 query_params = [] - if 'expand' in params: - query_params.append(('expand', params['expand'])) # noqa: E501 header_params = {} @@ -2523,14 +2531,14 @@ class DefaultApi(object): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/release/{id}', 'GET', + '/editgroup/{id}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='ReleaseEntity', # noqa: E501 + response_type='Editgroup', # noqa: E501 auth_settings=auth_settings, async=params.get('async'), _return_http_data_only=params.get('_return_http_data_only'), @@ -2538,38 +2546,38 @@ class DefaultApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def get_release_files(self, id, **kwargs): # noqa: E501 - """get_release_files # noqa: E501 + def get_editor(self, id, **kwargs): # noqa: E501 + """get_editor # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_release_files(id, async=True) + >>> thread = api.get_editor(id, async=True) >>> result = thread.get() :param async bool :param str id: (required) - :return: list[FileEntity] + :return: Editor If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.get_release_files_with_http_info(id, **kwargs) # noqa: E501 + return self.get_editor_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.get_release_files_with_http_info(id, **kwargs) # noqa: E501 + (data) = self.get_editor_with_http_info(id, **kwargs) # noqa: E501 return data - def get_release_files_with_http_info(self, id, **kwargs): # noqa: E501 - """get_release_files # noqa: E501 + def get_editor_with_http_info(self, id, **kwargs): # noqa: E501 + """get_editor # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_release_files_with_http_info(id, async=True) + >>> thread = api.get_editor_with_http_info(id, async=True) >>> result = thread.get() :param async bool :param str id: (required) - :return: list[FileEntity] + :return: Editor If the method is called asynchronously, returns the request thread. """ @@ -2585,14 +2593,14 @@ class DefaultApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method get_release_files" % key + " to method get_editor" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `get_release_files`") # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `get_editor`") # noqa: E501 collection_formats = {} @@ -2620,14 +2628,14 @@ class DefaultApi(object): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/release/{id}/files', 'GET', + '/editor/{id}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[FileEntity]', # noqa: E501 + response_type='Editor', # noqa: E501 auth_settings=auth_settings, async=params.get('async'), _return_http_data_only=params.get('_return_http_data_only'), @@ -2635,45 +2643,43 @@ class DefaultApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def get_release_history(self, id, **kwargs): # noqa: E501 - """get_release_history # noqa: E501 + def get_editor_changelog(self, id, **kwargs): # noqa: E501 + """get_editor_changelog # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_release_history(id, async=True) + >>> thread = api.get_editor_changelog(id, async=True) >>> result = thread.get() :param async bool :param str id: (required) - :param int limit: - :return: list[EntityHistoryEntry] + :return: list[ChangelogEntry] If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.get_release_history_with_http_info(id, **kwargs) # noqa: E501 + return self.get_editor_changelog_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.get_release_history_with_http_info(id, **kwargs) # noqa: E501 + (data) = self.get_editor_changelog_with_http_info(id, **kwargs) # noqa: E501 return data - def get_release_history_with_http_info(self, id, **kwargs): # noqa: E501 - """get_release_history # noqa: E501 + def get_editor_changelog_with_http_info(self, id, **kwargs): # noqa: E501 + """get_editor_changelog # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_release_history_with_http_info(id, async=True) + >>> thread = api.get_editor_changelog_with_http_info(id, async=True) >>> result = thread.get() :param async bool :param str id: (required) - :param int limit: - :return: list[EntityHistoryEntry] + :return: list[ChangelogEntry] If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'limit'] # noqa: E501 + all_params = ['id'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -2684,14 +2690,14 @@ class DefaultApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method get_release_history" % key + " to method get_editor_changelog" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `get_release_history`") # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `get_editor_changelog`") # noqa: E501 collection_formats = {} @@ -2700,8 +2706,6 @@ class DefaultApi(object): path_params['id'] = params['id'] # noqa: E501 query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 header_params = {} @@ -2721,14 +2725,14 @@ class DefaultApi(object): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/release/{id}/history', 'GET', + '/editor/{id}/changelog', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[EntityHistoryEntry]', # noqa: E501 + response_type='list[ChangelogEntry]', # noqa: E501 auth_settings=auth_settings, async=params.get('async'), _return_http_data_only=params.get('_return_http_data_only'), @@ -2736,43 +2740,45 @@ class DefaultApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def get_stats(self, **kwargs): # noqa: E501 - """get_stats # noqa: E501 + def get_file(self, id, **kwargs): # noqa: E501 + """get_file # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_stats(async=True) + >>> thread = api.get_file(id, async=True) >>> result = thread.get() :param async bool - :param str more: - :return: StatsResponse + :param str id: (required) + :param str expand: List of sub-entities to expand in response. For now, only 'all' accepted. + :return: FileEntity If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.get_stats_with_http_info(**kwargs) # noqa: E501 + return self.get_file_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.get_stats_with_http_info(**kwargs) # noqa: E501 + (data) = self.get_file_with_http_info(id, **kwargs) # noqa: E501 return data - def get_stats_with_http_info(self, **kwargs): # noqa: E501 - """get_stats # noqa: E501 + def get_file_with_http_info(self, id, **kwargs): # noqa: E501 + """get_file # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_stats_with_http_info(async=True) + >>> thread = api.get_file_with_http_info(id, async=True) >>> result = thread.get() :param async bool - :param str more: - :return: StatsResponse + :param str id: (required) + :param str expand: List of sub-entities to expand in response. For now, only 'all' accepted. + :return: FileEntity If the method is called asynchronously, returns the request thread. """ - all_params = ['more'] # noqa: E501 + all_params = ['id', 'expand'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -2783,18 +2789,24 @@ class DefaultApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method get_stats" % key + " to method get_file" % key ) params[key] = val del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_file`") # noqa: E501 collection_formats = {} path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 query_params = [] - if 'more' in params: - query_params.append(('more', params['more'])) # noqa: E501 + if 'expand' in params: + query_params.append(('expand', params['expand'])) # noqa: E501 header_params = {} @@ -2814,14 +2826,14 @@ class DefaultApi(object): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/stats', 'GET', + '/file/{id}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='StatsResponse', # noqa: E501 + response_type='FileEntity', # noqa: E501 auth_settings=auth_settings, async=params.get('async'), _return_http_data_only=params.get('_return_http_data_only'), @@ -2829,40 +2841,141 @@ class DefaultApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def get_work(self, id, **kwargs): # noqa: E501 - """get_work # noqa: E501 + def get_file_history(self, id, **kwargs): # noqa: E501 + """get_file_history # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_work(id, async=True) + >>> thread = api.get_file_history(id, async=True) + >>> result = thread.get() + + :param async bool + :param str id: (required) + :param int limit: + :return: list[EntityHistoryEntry] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.get_file_history_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.get_file_history_with_http_info(id, **kwargs) # noqa: E501 + return data + + def get_file_history_with_http_info(self, id, **kwargs): # noqa: E501 + """get_file_history # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.get_file_history_with_http_info(id, async=True) + >>> result = thread.get() + + :param async bool + :param str id: (required) + :param int limit: + :return: list[EntityHistoryEntry] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'limit'] # noqa: E501 + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_file_history" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_file_history`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/file/{id}/history', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[EntityHistoryEntry]', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_release(self, id, **kwargs): # noqa: E501 + """get_release # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.get_release(id, async=True) >>> result = thread.get() :param async bool :param str id: (required) :param str expand: List of sub-entities to expand in response. For now, only 'all' accepted. - :return: WorkEntity + :return: ReleaseEntity If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.get_work_with_http_info(id, **kwargs) # noqa: E501 + return self.get_release_with_http_info(id, **kwargs) # noqa: E501 else: - (data) = self.get_work_with_http_info(id, **kwargs) # noqa: E501 + (data) = self.get_release_with_http_info(id, **kwargs) # noqa: E501 return data - def get_work_with_http_info(self, id, **kwargs): # noqa: E501 - """get_work # noqa: E501 + def get_release_with_http_info(self, id, **kwargs): # noqa: E501 + """get_release # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_work_with_http_info(id, async=True) + >>> thread = api.get_release_with_http_info(id, async=True) >>> result = thread.get() :param async bool :param str id: (required) :param str expand: List of sub-entities to expand in response. For now, only 'all' accepted. - :return: WorkEntity + :return: ReleaseEntity If the method is called asynchronously, returns the request thread. """ @@ -2878,24 +2991,921 @@ class DefaultApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method get_work" % key + " to method get_release" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `get_work`") # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `get_release`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + if 'expand' in params: + query_params.append(('expand', params['expand'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/release/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ReleaseEntity', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_release_files(self, id, **kwargs): # noqa: E501 + """get_release_files # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.get_release_files(id, async=True) + >>> result = thread.get() + + :param async bool + :param str id: (required) + :return: list[FileEntity] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.get_release_files_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.get_release_files_with_http_info(id, **kwargs) # noqa: E501 + return data + + def get_release_files_with_http_info(self, id, **kwargs): # noqa: E501 + """get_release_files # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.get_release_files_with_http_info(id, async=True) + >>> result = thread.get() + + :param async bool + :param str id: (required) + :return: list[FileEntity] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_release_files" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_release_files`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/release/{id}/files', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[FileEntity]', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_release_history(self, id, **kwargs): # noqa: E501 + """get_release_history # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.get_release_history(id, async=True) + >>> result = thread.get() + + :param async bool + :param str id: (required) + :param int limit: + :return: list[EntityHistoryEntry] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.get_release_history_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.get_release_history_with_http_info(id, **kwargs) # noqa: E501 + return data + + def get_release_history_with_http_info(self, id, **kwargs): # noqa: E501 + """get_release_history # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.get_release_history_with_http_info(id, async=True) + >>> result = thread.get() + + :param async bool + :param str id: (required) + :param int limit: + :return: list[EntityHistoryEntry] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'limit'] # noqa: E501 + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_release_history" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_release_history`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/release/{id}/history', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[EntityHistoryEntry]', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_stats(self, **kwargs): # noqa: E501 + """get_stats # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.get_stats(async=True) + >>> result = thread.get() + + :param async bool + :param str more: + :return: StatsResponse + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.get_stats_with_http_info(**kwargs) # noqa: E501 + else: + (data) = self.get_stats_with_http_info(**kwargs) # noqa: E501 + return data + + def get_stats_with_http_info(self, **kwargs): # noqa: E501 + """get_stats # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.get_stats_with_http_info(async=True) + >>> result = thread.get() + + :param async bool + :param str more: + :return: StatsResponse + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['more'] # noqa: E501 + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_stats" % key + ) + params[key] = val + del params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'more' in params: + query_params.append(('more', params['more'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/stats', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='StatsResponse', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_work(self, id, **kwargs): # noqa: E501 + """get_work # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.get_work(id, async=True) + >>> result = thread.get() + + :param async bool + :param str id: (required) + :param str expand: List of sub-entities to expand in response. For now, only 'all' accepted. + :return: WorkEntity + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.get_work_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.get_work_with_http_info(id, **kwargs) # noqa: E501 + return data + + def get_work_with_http_info(self, id, **kwargs): # noqa: E501 + """get_work # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.get_work_with_http_info(id, async=True) + >>> result = thread.get() + + :param async bool + :param str id: (required) + :param str expand: List of sub-entities to expand in response. For now, only 'all' accepted. + :return: WorkEntity + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'expand'] # noqa: E501 + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_work" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_work`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + if 'expand' in params: + query_params.append(('expand', params['expand'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/work/{id}', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='WorkEntity', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_work_history(self, id, **kwargs): # noqa: E501 + """get_work_history # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.get_work_history(id, async=True) + >>> result = thread.get() + + :param async bool + :param str id: (required) + :param int limit: + :return: list[EntityHistoryEntry] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.get_work_history_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.get_work_history_with_http_info(id, **kwargs) # noqa: E501 + return data + + def get_work_history_with_http_info(self, id, **kwargs): # noqa: E501 + """get_work_history # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.get_work_history_with_http_info(id, async=True) + >>> result = thread.get() + + :param async bool + :param str id: (required) + :param int limit: + :return: list[EntityHistoryEntry] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id', 'limit'] # noqa: E501 + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_work_history" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_work_history`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + if 'limit' in params: + query_params.append(('limit', params['limit'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/work/{id}/history', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[EntityHistoryEntry]', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def get_work_releases(self, id, **kwargs): # noqa: E501 + """get_work_releases # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.get_work_releases(id, async=True) + >>> result = thread.get() + + :param async bool + :param str id: (required) + :return: list[ReleaseEntity] + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.get_work_releases_with_http_info(id, **kwargs) # noqa: E501 + else: + (data) = self.get_work_releases_with_http_info(id, **kwargs) # noqa: E501 + return data + + def get_work_releases_with_http_info(self, id, **kwargs): # noqa: E501 + """get_work_releases # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.get_work_releases_with_http_info(id, async=True) + >>> result = thread.get() + + :param async bool + :param str id: (required) + :return: list[ReleaseEntity] + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['id'] # noqa: E501 + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method get_work_releases" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `get_work_releases`") # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/work/{id}/releases', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[ReleaseEntity]', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def lookup_container(self, issnl, **kwargs): # noqa: E501 + """lookup_container # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.lookup_container(issnl, async=True) + >>> result = thread.get() + + :param async bool + :param str issnl: (required) + :return: ContainerEntity + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.lookup_container_with_http_info(issnl, **kwargs) # noqa: E501 + else: + (data) = self.lookup_container_with_http_info(issnl, **kwargs) # noqa: E501 + return data + + def lookup_container_with_http_info(self, issnl, **kwargs): # noqa: E501 + """lookup_container # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.lookup_container_with_http_info(issnl, async=True) + >>> result = thread.get() + + :param async bool + :param str issnl: (required) + :return: ContainerEntity + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['issnl'] # noqa: E501 + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method lookup_container" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'issnl' is set + if ('issnl' not in params or + params['issnl'] is None): + raise ValueError("Missing the required parameter `issnl` when calling `lookup_container`") # noqa: E501 + + if ('issnl' in params and + len(params['issnl']) > 9): + raise ValueError("Invalid value for parameter `issnl` when calling `lookup_container`, length must be less than or equal to `9`") # noqa: E501 + if ('issnl' in params and + len(params['issnl']) < 9): + raise ValueError("Invalid value for parameter `issnl` when calling `lookup_container`, length must be greater than or equal to `9`") # noqa: E501 + if 'issnl' in params and not re.search('\\d{4}-\\d{3}[0-9X]', params['issnl']): # noqa: E501 + raise ValueError("Invalid value for parameter `issnl` when calling `lookup_container`, must conform to the pattern `/\\d{4}-\\d{3}[0-9X]/`") # noqa: E501 + collection_formats = {} + + path_params = {} + + query_params = [] + if 'issnl' in params: + query_params.append(('issnl', params['issnl'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/container/lookup', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='ContainerEntity', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def lookup_creator(self, orcid, **kwargs): # noqa: E501 + """lookup_creator # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.lookup_creator(orcid, async=True) + >>> result = thread.get() + + :param async bool + :param str orcid: (required) + :return: CreatorEntity + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.lookup_creator_with_http_info(orcid, **kwargs) # noqa: E501 + else: + (data) = self.lookup_creator_with_http_info(orcid, **kwargs) # noqa: E501 + return data + + def lookup_creator_with_http_info(self, orcid, **kwargs): # noqa: E501 + """lookup_creator # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.lookup_creator_with_http_info(orcid, async=True) + >>> result = thread.get() + + :param async bool + :param str orcid: (required) + :return: CreatorEntity + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['orcid'] # noqa: E501 + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method lookup_creator" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'orcid' is set + if ('orcid' not in params or + params['orcid'] is None): + raise ValueError("Missing the required parameter `orcid` when calling `lookup_creator`") # noqa: E501 + + if ('orcid' in params and + len(params['orcid']) > 19): + raise ValueError("Invalid value for parameter `orcid` when calling `lookup_creator`, length must be less than or equal to `19`") # noqa: E501 + if ('orcid' in params and + len(params['orcid']) < 19): + raise ValueError("Invalid value for parameter `orcid` when calling `lookup_creator`, length must be greater than or equal to `19`") # noqa: E501 + if 'orcid' in params and not re.search('\\d{4}-\\d{4}-\\d{4}-\\d{3}[\\dX]', params['orcid']): # noqa: E501 + raise ValueError("Invalid value for parameter `orcid` when calling `lookup_creator`, must conform to the pattern `/\\d{4}-\\d{4}-\\d{4}-\\d{3}[\\dX]/`") # noqa: E501 + collection_formats = {} + + path_params = {} + + query_params = [] + if 'orcid' in params: + query_params.append(('orcid', params['orcid'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept( + ['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/creator/lookup', 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='CreatorEntity', # noqa: E501 + auth_settings=auth_settings, + async=params.get('async'), + _return_http_data_only=params.get('_return_http_data_only'), + _preload_content=params.get('_preload_content', True), + _request_timeout=params.get('_request_timeout'), + collection_formats=collection_formats) + + def lookup_file(self, sha1, **kwargs): # noqa: E501 + """lookup_file # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.lookup_file(sha1, async=True) + >>> result = thread.get() + + :param async bool + :param str sha1: (required) + :return: FileEntity + If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + if kwargs.get('async'): + return self.lookup_file_with_http_info(sha1, **kwargs) # noqa: E501 + else: + (data) = self.lookup_file_with_http_info(sha1, **kwargs) # noqa: E501 + return data + + def lookup_file_with_http_info(self, sha1, **kwargs): # noqa: E501 + """lookup_file # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async=True + >>> thread = api.lookup_file_with_http_info(sha1, async=True) + >>> result = thread.get() + + :param async bool + :param str sha1: (required) + :return: FileEntity + If the method is called asynchronously, + returns the request thread. + """ + + all_params = ['sha1'] # noqa: E501 + all_params.append('async') + all_params.append('_return_http_data_only') + all_params.append('_preload_content') + all_params.append('_request_timeout') + + params = locals() + for key, val in six.iteritems(params['kwargs']): + if key not in all_params: + raise TypeError( + "Got an unexpected keyword argument '%s'" + " to method lookup_file" % key + ) + params[key] = val + del params['kwargs'] + # verify the required parameter 'sha1' is set + if ('sha1' not in params or + params['sha1'] is None): + raise ValueError("Missing the required parameter `sha1` when calling `lookup_file`") # noqa: E501 collection_formats = {} path_params = {} - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 query_params = [] - if 'expand' in params: - query_params.append(('expand', params['expand'])) # noqa: E501 + if 'sha1' in params: + query_params.append(('sha1', params['sha1'])) # noqa: E501 header_params = {} @@ -2915,14 +3925,14 @@ class DefaultApi(object): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/work/{id}', 'GET', + '/file/lookup', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='WorkEntity', # noqa: E501 + response_type='FileEntity', # noqa: E501 auth_settings=auth_settings, async=params.get('async'), _return_http_data_only=params.get('_return_http_data_only'), @@ -2930,45 +3940,43 @@ class DefaultApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def get_work_history(self, id, **kwargs): # noqa: E501 - """get_work_history # noqa: E501 + def lookup_release(self, doi, **kwargs): # noqa: E501 + """lookup_release # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_work_history(id, async=True) + >>> thread = api.lookup_release(doi, async=True) >>> result = thread.get() :param async bool - :param str id: (required) - :param int limit: - :return: list[EntityHistoryEntry] + :param str doi: (required) + :return: ReleaseEntity If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.get_work_history_with_http_info(id, **kwargs) # noqa: E501 + return self.lookup_release_with_http_info(doi, **kwargs) # noqa: E501 else: - (data) = self.get_work_history_with_http_info(id, **kwargs) # noqa: E501 + (data) = self.lookup_release_with_http_info(doi, **kwargs) # noqa: E501 return data - def get_work_history_with_http_info(self, id, **kwargs): # noqa: E501 - """get_work_history # noqa: E501 + def lookup_release_with_http_info(self, doi, **kwargs): # noqa: E501 + """lookup_release # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_work_history_with_http_info(id, async=True) + >>> thread = api.lookup_release_with_http_info(doi, async=True) >>> result = thread.get() :param async bool - :param str id: (required) - :param int limit: - :return: list[EntityHistoryEntry] + :param str doi: (required) + :return: ReleaseEntity If the method is called asynchronously, returns the request thread. """ - all_params = ['id', 'limit'] # noqa: E501 + all_params = ['doi'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -2979,24 +3987,22 @@ class DefaultApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method get_work_history" % key + " to method lookup_release" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'id' is set - if ('id' not in params or - params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `get_work_history`") # noqa: E501 + # verify the required parameter 'doi' is set + if ('doi' not in params or + params['doi'] is None): + raise ValueError("Missing the required parameter `doi` when calling `lookup_release`") # noqa: E501 collection_formats = {} path_params = {} - if 'id' in params: - path_params['id'] = params['id'] # noqa: E501 query_params = [] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 + if 'doi' in params: + query_params.append(('doi', params['doi'])) # noqa: E501 header_params = {} @@ -3016,14 +4022,14 @@ class DefaultApi(object): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/work/{id}/history', 'GET', + '/release/lookup', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[EntityHistoryEntry]', # noqa: E501 + response_type='ReleaseEntity', # noqa: E501 auth_settings=auth_settings, async=params.get('async'), _return_http_data_only=params.get('_return_http_data_only'), @@ -3031,43 +4037,45 @@ class DefaultApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def get_work_releases(self, id, **kwargs): # noqa: E501 - """get_work_releases # noqa: E501 + def update_container(self, id, entity, **kwargs): # noqa: E501 + """update_container # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_work_releases(id, async=True) + >>> thread = api.update_container(id, entity, async=True) >>> result = thread.get() :param async bool :param str id: (required) - :return: list[ReleaseEntity] + :param ContainerEntity entity: (required) + :return: EntityEdit If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.get_work_releases_with_http_info(id, **kwargs) # noqa: E501 + return self.update_container_with_http_info(id, entity, **kwargs) # noqa: E501 else: - (data) = self.get_work_releases_with_http_info(id, **kwargs) # noqa: E501 + (data) = self.update_container_with_http_info(id, entity, **kwargs) # noqa: E501 return data - def get_work_releases_with_http_info(self, id, **kwargs): # noqa: E501 - """get_work_releases # noqa: E501 + def update_container_with_http_info(self, id, entity, **kwargs): # noqa: E501 + """update_container # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.get_work_releases_with_http_info(id, async=True) + >>> thread = api.update_container_with_http_info(id, entity, async=True) >>> result = thread.get() :param async bool :param str id: (required) - :return: list[ReleaseEntity] + :param ContainerEntity entity: (required) + :return: EntityEdit If the method is called asynchronously, returns the request thread. """ - all_params = ['id'] # noqa: E501 + all_params = ['id', 'entity'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -3078,14 +4086,18 @@ class DefaultApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method get_work_releases" % key + " to method update_container" % key ) params[key] = val del params['kwargs'] # verify the required parameter 'id' is set if ('id' not in params or params['id'] is None): - raise ValueError("Missing the required parameter `id` when calling `get_work_releases`") # noqa: E501 + raise ValueError("Missing the required parameter `id` when calling `update_container`") # noqa: E501 + # verify the required parameter 'entity' is set + if ('entity' not in params or + params['entity'] is None): + raise ValueError("Missing the required parameter `entity` when calling `update_container`") # noqa: E501 collection_formats = {} @@ -3101,6 +4113,8 @@ class DefaultApi(object): local_var_files = {} body_params = None + if 'entity' in params: + body_params = params['entity'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 @@ -3113,14 +4127,14 @@ class DefaultApi(object): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/work/{id}/releases', 'GET', + '/container/{id}', 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='list[ReleaseEntity]', # noqa: E501 + response_type='EntityEdit', # noqa: E501 auth_settings=auth_settings, async=params.get('async'), _return_http_data_only=params.get('_return_http_data_only'), @@ -3128,43 +4142,45 @@ class DefaultApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def lookup_container(self, issnl, **kwargs): # noqa: E501 - """lookup_container # noqa: E501 + def update_creator(self, id, entity, **kwargs): # noqa: E501 + """update_creator # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.lookup_container(issnl, async=True) + >>> thread = api.update_creator(id, entity, async=True) >>> result = thread.get() :param async bool - :param str issnl: (required) - :return: ContainerEntity + :param str id: (required) + :param CreatorEntity entity: (required) + :return: EntityEdit If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.lookup_container_with_http_info(issnl, **kwargs) # noqa: E501 + return self.update_creator_with_http_info(id, entity, **kwargs) # noqa: E501 else: - (data) = self.lookup_container_with_http_info(issnl, **kwargs) # noqa: E501 + (data) = self.update_creator_with_http_info(id, entity, **kwargs) # noqa: E501 return data - def lookup_container_with_http_info(self, issnl, **kwargs): # noqa: E501 - """lookup_container # noqa: E501 + def update_creator_with_http_info(self, id, entity, **kwargs): # noqa: E501 + """update_creator # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.lookup_container_with_http_info(issnl, async=True) + >>> thread = api.update_creator_with_http_info(id, entity, async=True) >>> result = thread.get() :param async bool - :param str issnl: (required) - :return: ContainerEntity + :param str id: (required) + :param CreatorEntity entity: (required) + :return: EntityEdit If the method is called asynchronously, returns the request thread. """ - all_params = ['issnl'] # noqa: E501 + all_params = ['id', 'entity'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -3175,30 +4191,26 @@ class DefaultApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method lookup_container" % key + " to method update_creator" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'issnl' is set - if ('issnl' not in params or - params['issnl'] is None): - raise ValueError("Missing the required parameter `issnl` when calling `lookup_container`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `update_creator`") # noqa: E501 + # verify the required parameter 'entity' is set + if ('entity' not in params or + params['entity'] is None): + raise ValueError("Missing the required parameter `entity` when calling `update_creator`") # noqa: E501 - if ('issnl' in params and - len(params['issnl']) > 9): - raise ValueError("Invalid value for parameter `issnl` when calling `lookup_container`, length must be less than or equal to `9`") # noqa: E501 - if ('issnl' in params and - len(params['issnl']) < 9): - raise ValueError("Invalid value for parameter `issnl` when calling `lookup_container`, length must be greater than or equal to `9`") # noqa: E501 - if 'issnl' in params and not re.search('\\d{4}-\\d{3}[0-9X]', params['issnl']): # noqa: E501 - raise ValueError("Invalid value for parameter `issnl` when calling `lookup_container`, must conform to the pattern `/\\d{4}-\\d{3}[0-9X]/`") # noqa: E501 collection_formats = {} path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 query_params = [] - if 'issnl' in params: - query_params.append(('issnl', params['issnl'])) # noqa: E501 header_params = {} @@ -3206,6 +4218,8 @@ class DefaultApi(object): local_var_files = {} body_params = None + if 'entity' in params: + body_params = params['entity'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 @@ -3218,14 +4232,14 @@ class DefaultApi(object): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/container/lookup', 'GET', + '/creator/{id}', 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='ContainerEntity', # noqa: E501 + response_type='EntityEdit', # noqa: E501 auth_settings=auth_settings, async=params.get('async'), _return_http_data_only=params.get('_return_http_data_only'), @@ -3233,43 +4247,45 @@ class DefaultApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def lookup_creator(self, orcid, **kwargs): # noqa: E501 - """lookup_creator # noqa: E501 + def update_file(self, id, entity, **kwargs): # noqa: E501 + """update_file # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.lookup_creator(orcid, async=True) + >>> thread = api.update_file(id, entity, async=True) >>> result = thread.get() :param async bool - :param str orcid: (required) - :return: CreatorEntity + :param str id: (required) + :param FileEntity entity: (required) + :return: EntityEdit If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.lookup_creator_with_http_info(orcid, **kwargs) # noqa: E501 + return self.update_file_with_http_info(id, entity, **kwargs) # noqa: E501 else: - (data) = self.lookup_creator_with_http_info(orcid, **kwargs) # noqa: E501 + (data) = self.update_file_with_http_info(id, entity, **kwargs) # noqa: E501 return data - def lookup_creator_with_http_info(self, orcid, **kwargs): # noqa: E501 - """lookup_creator # noqa: E501 + def update_file_with_http_info(self, id, entity, **kwargs): # noqa: E501 + """update_file # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.lookup_creator_with_http_info(orcid, async=True) + >>> thread = api.update_file_with_http_info(id, entity, async=True) >>> result = thread.get() :param async bool - :param str orcid: (required) - :return: CreatorEntity + :param str id: (required) + :param FileEntity entity: (required) + :return: EntityEdit If the method is called asynchronously, returns the request thread. """ - all_params = ['orcid'] # noqa: E501 + all_params = ['id', 'entity'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -3280,30 +4296,26 @@ class DefaultApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method lookup_creator" % key + " to method update_file" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'orcid' is set - if ('orcid' not in params or - params['orcid'] is None): - raise ValueError("Missing the required parameter `orcid` when calling `lookup_creator`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `update_file`") # noqa: E501 + # verify the required parameter 'entity' is set + if ('entity' not in params or + params['entity'] is None): + raise ValueError("Missing the required parameter `entity` when calling `update_file`") # noqa: E501 - if ('orcid' in params and - len(params['orcid']) > 19): - raise ValueError("Invalid value for parameter `orcid` when calling `lookup_creator`, length must be less than or equal to `19`") # noqa: E501 - if ('orcid' in params and - len(params['orcid']) < 19): - raise ValueError("Invalid value for parameter `orcid` when calling `lookup_creator`, length must be greater than or equal to `19`") # noqa: E501 - if 'orcid' in params and not re.search('\\d{4}-\\d{4}-\\d{4}-\\d{3}[\\dX]', params['orcid']): # noqa: E501 - raise ValueError("Invalid value for parameter `orcid` when calling `lookup_creator`, must conform to the pattern `/\\d{4}-\\d{4}-\\d{4}-\\d{3}[\\dX]/`") # noqa: E501 collection_formats = {} path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 query_params = [] - if 'orcid' in params: - query_params.append(('orcid', params['orcid'])) # noqa: E501 header_params = {} @@ -3311,6 +4323,8 @@ class DefaultApi(object): local_var_files = {} body_params = None + if 'entity' in params: + body_params = params['entity'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 @@ -3323,14 +4337,14 @@ class DefaultApi(object): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/creator/lookup', 'GET', + '/file/{id}', 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='CreatorEntity', # noqa: E501 + response_type='EntityEdit', # noqa: E501 auth_settings=auth_settings, async=params.get('async'), _return_http_data_only=params.get('_return_http_data_only'), @@ -3338,43 +4352,45 @@ class DefaultApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def lookup_file(self, sha1, **kwargs): # noqa: E501 - """lookup_file # noqa: E501 + def update_release(self, id, entity, **kwargs): # noqa: E501 + """update_release # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.lookup_file(sha1, async=True) + >>> thread = api.update_release(id, entity, async=True) >>> result = thread.get() :param async bool - :param str sha1: (required) - :return: FileEntity + :param str id: (required) + :param ReleaseEntity entity: (required) + :return: EntityEdit If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.lookup_file_with_http_info(sha1, **kwargs) # noqa: E501 + return self.update_release_with_http_info(id, entity, **kwargs) # noqa: E501 else: - (data) = self.lookup_file_with_http_info(sha1, **kwargs) # noqa: E501 + (data) = self.update_release_with_http_info(id, entity, **kwargs) # noqa: E501 return data - def lookup_file_with_http_info(self, sha1, **kwargs): # noqa: E501 - """lookup_file # noqa: E501 + def update_release_with_http_info(self, id, entity, **kwargs): # noqa: E501 + """update_release # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.lookup_file_with_http_info(sha1, async=True) + >>> thread = api.update_release_with_http_info(id, entity, async=True) >>> result = thread.get() :param async bool - :param str sha1: (required) - :return: FileEntity + :param str id: (required) + :param ReleaseEntity entity: (required) + :return: EntityEdit If the method is called asynchronously, returns the request thread. """ - all_params = ['sha1'] # noqa: E501 + all_params = ['id', 'entity'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -3385,22 +4401,26 @@ class DefaultApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method lookup_file" % key + " to method update_release" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'sha1' is set - if ('sha1' not in params or - params['sha1'] is None): - raise ValueError("Missing the required parameter `sha1` when calling `lookup_file`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `update_release`") # noqa: E501 + # verify the required parameter 'entity' is set + if ('entity' not in params or + params['entity'] is None): + raise ValueError("Missing the required parameter `entity` when calling `update_release`") # noqa: E501 collection_formats = {} path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 query_params = [] - if 'sha1' in params: - query_params.append(('sha1', params['sha1'])) # noqa: E501 header_params = {} @@ -3408,6 +4428,8 @@ class DefaultApi(object): local_var_files = {} body_params = None + if 'entity' in params: + body_params = params['entity'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 @@ -3420,14 +4442,14 @@ class DefaultApi(object): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/file/lookup', 'GET', + '/release/{id}', 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='FileEntity', # noqa: E501 + response_type='EntityEdit', # noqa: E501 auth_settings=auth_settings, async=params.get('async'), _return_http_data_only=params.get('_return_http_data_only'), @@ -3435,43 +4457,45 @@ class DefaultApi(object): _request_timeout=params.get('_request_timeout'), collection_formats=collection_formats) - def lookup_release(self, doi, **kwargs): # noqa: E501 - """lookup_release # noqa: E501 + def update_work(self, id, entity, **kwargs): # noqa: E501 + """update_work # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.lookup_release(doi, async=True) + >>> thread = api.update_work(id, entity, async=True) >>> result = thread.get() :param async bool - :param str doi: (required) - :return: ReleaseEntity + :param str id: (required) + :param WorkEntity entity: (required) + :return: EntityEdit If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async'): - return self.lookup_release_with_http_info(doi, **kwargs) # noqa: E501 + return self.update_work_with_http_info(id, entity, **kwargs) # noqa: E501 else: - (data) = self.lookup_release_with_http_info(doi, **kwargs) # noqa: E501 + (data) = self.update_work_with_http_info(id, entity, **kwargs) # noqa: E501 return data - def lookup_release_with_http_info(self, doi, **kwargs): # noqa: E501 - """lookup_release # noqa: E501 + def update_work_with_http_info(self, id, entity, **kwargs): # noqa: E501 + """update_work # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async=True - >>> thread = api.lookup_release_with_http_info(doi, async=True) + >>> thread = api.update_work_with_http_info(id, entity, async=True) >>> result = thread.get() :param async bool - :param str doi: (required) - :return: ReleaseEntity + :param str id: (required) + :param WorkEntity entity: (required) + :return: EntityEdit If the method is called asynchronously, returns the request thread. """ - all_params = ['doi'] # noqa: E501 + all_params = ['id', 'entity'] # noqa: E501 all_params.append('async') all_params.append('_return_http_data_only') all_params.append('_preload_content') @@ -3482,22 +4506,26 @@ class DefaultApi(object): if key not in all_params: raise TypeError( "Got an unexpected keyword argument '%s'" - " to method lookup_release" % key + " to method update_work" % key ) params[key] = val del params['kwargs'] - # verify the required parameter 'doi' is set - if ('doi' not in params or - params['doi'] is None): - raise ValueError("Missing the required parameter `doi` when calling `lookup_release`") # noqa: E501 + # verify the required parameter 'id' is set + if ('id' not in params or + params['id'] is None): + raise ValueError("Missing the required parameter `id` when calling `update_work`") # noqa: E501 + # verify the required parameter 'entity' is set + if ('entity' not in params or + params['entity'] is None): + raise ValueError("Missing the required parameter `entity` when calling `update_work`") # noqa: E501 collection_formats = {} path_params = {} + if 'id' in params: + path_params['id'] = params['id'] # noqa: E501 query_params = [] - if 'doi' in params: - query_params.append(('doi', params['doi'])) # noqa: E501 header_params = {} @@ -3505,6 +4533,8 @@ class DefaultApi(object): local_var_files = {} body_params = None + if 'entity' in params: + body_params = params['entity'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 @@ -3517,14 +4547,14 @@ class DefaultApi(object): auth_settings = [] # noqa: E501 return self.api_client.call_api( - '/release/lookup', 'GET', + '/work/{id}', 'PUT', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, - response_type='ReleaseEntity', # noqa: E501 + response_type='EntityEdit', # noqa: E501 auth_settings=auth_settings, async=params.get('async'), _return_http_data_only=params.get('_return_http_data_only'), diff --git a/python/tests/codegen_tests/test_default_api.py b/python/tests/codegen_tests/test_default_api.py index e3008898..ec36887b 100644 --- a/python/tests/codegen_tests/test_default_api.py +++ b/python/tests/codegen_tests/test_default_api.py @@ -101,6 +101,36 @@ class TestDefaultApi(unittest.TestCase): """ pass + def test_delete_container(self): + """Test case for delete_container + + """ + pass + + def test_delete_creator(self): + """Test case for delete_creator + + """ + pass + + def test_delete_file(self): + """Test case for delete_file + + """ + pass + + def test_delete_release(self): + """Test case for delete_release + + """ + pass + + def test_delete_work(self): + """Test case for delete_work + + """ + pass + def test_get_changelog(self): """Test case for get_changelog @@ -239,6 +269,36 @@ class TestDefaultApi(unittest.TestCase): """ pass + def test_update_container(self): + """Test case for update_container + + """ + pass + + def test_update_creator(self): + """Test case for update_creator + + """ + pass + + def test_update_file(self): + """Test case for update_file + + """ + pass + + def test_update_release(self): + """Test case for update_release + + """ + pass + + def test_update_work(self): + """Test case for update_work + + """ + pass + if __name__ == '__main__': unittest.main() diff --git a/rust/TODO b/rust/TODO index ed38b915..05ad76d8 100644 --- a/rust/TODO +++ b/rust/TODO @@ -1,4 +1,6 @@ +- database_entity_crud -> api_entity_crud +- merge autoaccept branch in with http-verbs branch - fatcat_api -> fatcat_api_schema (or spec? models? types?) - fatcat -> fatcat-api-server - refactor rev creation (from an entity) into it's own function, across the board diff --git a/rust/src/api_server.rs b/rust/src/api_server.rs index 56fbca19..31b71395 100644 --- a/rust/src/api_server.rs +++ b/rust/src/api_server.rs @@ -39,7 +39,6 @@ macro_rules! entity_batch_handler { if autoaccept { let _clr: ChangelogRow = diesel::insert_into(changelog::table) - // if autoaccept, eg_id is always Some .values((changelog::editgroup_id.eq(edit_context.editgroup_id.to_uuid()),)) .get_result(conn)?; } -- cgit v1.2.3