Skip to content

Commit

Permalink
response type for metadata api methods is Response (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
charlottekostelic authored Nov 7, 2024
1 parent 52f0d2f commit 1bcfb7c
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions bookops_worldcat/metadata_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def bib_create(
recordFormat: str,
responseFormat: str = "application/marcxml+xml",
hooks: Optional[Dict[str, Callable]] = None,
) -> Optional[Response]:
) -> Response:
"""
Create a bib record in OCLC if it does not already exist.
Expand Down Expand Up @@ -217,7 +217,7 @@ def bib_get(
oclcNumber: Union[int, str],
responseFormat: str = "application/marcxml+xml",
hooks: Optional[Dict[str, Callable]] = None,
) -> Optional[Response]:
) -> Response:
"""
Send a GET request for a full bib record.
Expand Down Expand Up @@ -257,7 +257,7 @@ def bib_get_classification(
self,
oclcNumber: Union[int, str],
hooks: Optional[Dict[str, Callable]] = None,
) -> Optional[Response]:
) -> Response:
"""
Given an OCLC number, retrieve classification recommendations for the bib
record.
Expand Down Expand Up @@ -294,7 +294,7 @@ def bib_get_current_oclc_number(
self,
oclcNumbers: Union[int, str, List[Union[str, int]]],
hooks: Optional[Dict[str, Callable]] = None,
) -> Optional[Response]:
) -> Response:
"""
Given one or more OCLC Numbers, retrieve current OCLC numbers.
Expand Down Expand Up @@ -338,7 +338,7 @@ def bib_match(
record: Union[str, bytes, BinaryIO],
recordFormat: str,
hooks: Optional[Dict[str, Callable]] = None,
) -> Optional[Response]:
) -> Response:
"""
Given a bib record in MARC21 or MARCXML identify the best match in WorldCat.
Record must contain at minimum an 008 and 245. Response contains number of
Expand Down Expand Up @@ -383,7 +383,7 @@ def bib_replace(
recordFormat: str,
responseFormat: str = "application/marcxml+xml",
hooks: Optional[Dict[str, Callable]] = None,
) -> Optional[Response]:
) -> Response:
"""
Given an OCLC number and MARC record, find record in WorldCat and replace it.
If the record does not exist in WorldCat, a new bib record will be created.
Expand Down Expand Up @@ -432,7 +432,7 @@ def bib_validate(
recordFormat: str,
validationLevel: str = "validateFull",
hooks: Optional[Dict[str, Callable]] = None,
) -> Optional[Response]:
) -> Response:
"""
Given a bib record, validate that record conforms to MARC standards.
Expand Down Expand Up @@ -491,7 +491,7 @@ def bib_validate(

def brief_bibs_get(
self, oclcNumber: Union[int, str], hooks: Optional[Dict[str, Callable]] = None
) -> Optional[Response]:
) -> Response:
"""
Retrieve specific brief bibliographic resource.
Expand Down Expand Up @@ -559,7 +559,7 @@ def brief_bibs_search(
offset: int = 1,
limit: int = 10,
hooks: Optional[Dict[str, Callable]] = None,
) -> Optional[Response]:
) -> Response:
"""
Search for brief bibliographic resources using WorldCat query syntax.
See OCLC
Expand Down Expand Up @@ -783,7 +783,7 @@ def brief_bibs_get_other_editions(
limit: int = 10,
orderBy: str = "publicationDateDesc",
hooks: Optional[Dict[str, Callable]] = None,
) -> Optional[Response]:
) -> Response:
"""
Retrieve other editions related to bibliographic resource with provided
OCLC Number. Query may contain only one of: `heldByInstitutionID`,
Expand Down Expand Up @@ -945,7 +945,7 @@ def brief_bibs_get_other_editions(
def holdings_get_codes(
self,
hooks: Optional[Dict[str, Callable]] = None,
) -> Optional[Response]:
) -> Response:
"""
Retrieve the all holding codes for the authenticated institution.
Expand Down Expand Up @@ -976,7 +976,7 @@ def holdings_get_current(
self,
oclcNumbers: Union[int, str, List[Union[str, int]]],
hooks: Optional[Dict[str, Callable]] = None,
) -> Optional[Response]:
) -> Response:
"""
Retrieves WorldCat holdings status of a record with provided OCLC number.
The service automatically recognizes the user's institution based on the
Expand Down Expand Up @@ -1025,7 +1025,7 @@ def holdings_set(
self,
oclcNumber: Union[int, str],
hooks: Optional[Dict[str, Callable]] = None,
) -> Optional[Response]:
) -> Response:
"""
Sets institution's WorldCat holdings on an individual record.
Expand Down Expand Up @@ -1061,7 +1061,7 @@ def holdings_unset(
self,
oclcNumber: Union[int, str],
hooks: Optional[Dict[str, Callable]] = None,
) -> Optional[Response]:
) -> Response:
"""
Unsets institution's WorldCat holdings on an individual record.
Expand Down Expand Up @@ -1098,7 +1098,7 @@ def holdings_set_with_bib(
record: str,
recordFormat: str,
hooks: Optional[Dict[str, Callable]] = None,
) -> Optional[Response]:
) -> Response:
"""
Given a MARC record in MARCXML or MARC21, set institution holdings on the
record. MARC record must contain OCLC number in 001 or 035 subfield a.
Expand Down Expand Up @@ -1141,7 +1141,7 @@ def holdings_unset_with_bib(
record: str,
recordFormat: str,
hooks: Optional[Dict[str, Callable]] = None,
) -> Optional[Response]:
) -> Response:
"""
Given a MARC record in MARCXML or MARC21, unset institution holdings on the
record. MARC record must contain OCLC number in 001 or 035 subfield a.
Expand Down Expand Up @@ -1184,7 +1184,7 @@ def lbd_create(
recordFormat: str,
responseFormat: str = "application/marcxml+xml",
hooks: Optional[Dict[str, Callable]] = None,
) -> Optional[Response]:
) -> Response:
"""
Given a local bibliographic data record, create it in WorldCat.
Expand Down Expand Up @@ -1229,7 +1229,7 @@ def lbd_delete(
controlNumber: Union[int, str],
responseFormat: str = "application/marcxml+xml",
hooks: Optional[Dict[str, Callable]] = None,
) -> Optional[Response]:
) -> Response:
"""
Given a control number, delete the associated Local Bibliographic Data record.
Expand Down Expand Up @@ -1268,7 +1268,7 @@ def lbd_get(
controlNumber: Union[int, str],
responseFormat: str = "application/marcxml+xml",
hooks: Optional[Dict[str, Callable]] = None,
) -> Optional[Response]:
) -> Response:
"""
Given a Control Number, retrieve a Local Bibliographic Data record.
Expand Down Expand Up @@ -1309,7 +1309,7 @@ def lbd_replace(
recordFormat: str,
responseFormat: str = "application/marcxml+xml",
hooks: Optional[Dict[str, Callable]] = None,
) -> Optional[Response]:
) -> Response:
"""
Given a Control Number, find the associated Local Bibliographic Data
Record and replace it. If the Control Number is not found in
Expand Down Expand Up @@ -1360,7 +1360,7 @@ def lhr_create(
recordFormat: str,
responseFormat: str = "application/marcxml+xml",
hooks: Optional[Dict[str, Callable]] = None,
) -> Optional[Response]:
) -> Response:
"""
Given a local holdings record, create it in WorldCat
Expand Down Expand Up @@ -1405,7 +1405,7 @@ def lhr_delete(
controlNumber: Union[int, str],
responseFormat: str = "application/marcxml+xml",
hooks: Optional[Dict[str, Callable]] = None,
) -> Optional[Response]:
) -> Response:
"""
Given a control number, delete a Local Holdings record.
Expand Down Expand Up @@ -1444,7 +1444,7 @@ def lhr_get(
controlNumber: Union[int, str],
responseFormat: str = "application/marcxml+xml",
hooks: Optional[Dict[str, Callable]] = None,
) -> Optional[Response]:
) -> Response:
"""
Send a GET request for a local holdings record
Expand Down Expand Up @@ -1485,7 +1485,7 @@ def lhr_replace(
recordFormat: str,
responseFormat: str = "application/marcxml+xml",
hooks: Optional[Dict[str, Callable]] = None,
) -> Optional[Response]:
) -> Response:
"""
Given a Control Number, find the associated Local Holdings
Record and replace it. If the Control Number is not found in
Expand Down Expand Up @@ -1534,7 +1534,7 @@ def local_bibs_get(
self,
controlNumber: Union[int, str],
hooks: Optional[Dict[str, Callable]] = None,
) -> Optional[Response]:
) -> Response:
"""
Retrieve LBD Resource.
Expand Down Expand Up @@ -1570,7 +1570,7 @@ def local_bibs_search(
offset: int = 1,
limit: int = 10,
hooks: Optional[Dict[str, Callable]] = None,
) -> Optional[Response]:
) -> Response:
"""
Search LBD Resources using WorldCat query syntax. See OCLC
[Local Bibliographic Data Record Index](https://help.oclc.org/Librarian_Toolbox/Searching_WorldCat_Indexes/Local_bibliographic_data_records/Local_bibliographic_data_record_indexes_A-Z)
Expand Down Expand Up @@ -1626,7 +1626,7 @@ def local_holdings_browse(
browsePosition: int = 0,
limit: int = 10,
hooks: Optional[Dict[str, Callable]] = None,
) -> Optional[Response]:
) -> Response:
"""
Browse local holdings.
Expand Down Expand Up @@ -1683,7 +1683,7 @@ def local_holdings_get(
self,
controlNumber: Union[int, str],
hooks: Optional[Dict[str, Callable]] = None,
) -> Optional[Response]:
) -> Response:
"""
Retrieve LHR Resource.
Expand Down Expand Up @@ -1721,7 +1721,7 @@ def local_holdings_search(
offset: int = 1,
limit: int = 10,
hooks: Optional[Dict[str, Callable]] = None,
) -> Optional[Response]:
) -> Response:
"""
Search LHR Resources. Query must contain, at minimum, either an
`oclcNumber` or `barcode`.
Expand Down Expand Up @@ -1785,7 +1785,7 @@ def local_holdings_search_shared_print(
offset: int = 1,
limit: int = 10,
hooks: Optional[Dict[str, Callable]] = None,
) -> Optional[Response]:
) -> Response:
"""
Search for shared print LHR Resources. Query must contain, at minimum,
either an `oclcNumber` or `barcode` and a value for either
Expand Down Expand Up @@ -1859,7 +1859,7 @@ def shared_print_holdings_search(
itemType: Optional[List[str]] = None,
itemSubType: Optional[List[str]] = None,
hooks: Optional[Dict[str, Callable]] = None,
) -> Optional[Response]:
) -> Response:
"""
Finds member shared print holdings for specified item. Query must
contain, at minimum, either an `oclcNumber`, `isbn`, or `issn`.
Expand Down Expand Up @@ -1944,7 +1944,7 @@ def summary_holdings_search(
distance: Optional[int] = None,
unit: str = "M",
hooks: Optional[Dict[str, Callable]] = None,
) -> Optional[Response]:
) -> Response:
"""
Given a known item, get summary of holdings and brief bib record. Query must
contain, at minimum, either an OCLC Number, ISBN, or ISSN. Query may contain
Expand Down Expand Up @@ -2074,7 +2074,7 @@ def summary_holdings_get(
distance: Optional[int] = None,
unit: str = "M",
hooks: Optional[Dict[str, Callable]] = None,
) -> Optional[Response]:
) -> Response:
"""
Given an OCLC number, get summary of holdings. Query may contain
only one of: `heldByInstitutionId`, `heldByGroup`, `heldBySymbol`,
Expand Down

0 comments on commit 1bcfb7c

Please sign in to comment.