|
| 1 | +# Zed Attack Proxy (ZAP) and its related class files. |
| 2 | +# |
| 3 | +# ZAP is an HTTP/HTTPS proxy for assessing web application security. |
| 4 | +# |
| 5 | +# Copyright 2020 the ZAP development team |
| 6 | +# |
| 7 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | +# you may not use this file except in compliance with the License. |
| 9 | +# You may obtain a copy of the License at |
| 10 | +# |
| 11 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | +# |
| 13 | +# Unless required by applicable law or agreed to in writing, software |
| 14 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | +# See the License for the specific language governing permissions and |
| 17 | +# limitations under the License. |
| 18 | +""" |
| 19 | +This file was automatically generated. |
| 20 | +""" |
| 21 | + |
| 22 | +import six |
| 23 | + |
| 24 | + |
| 25 | +class graphql(object): |
| 26 | + |
| 27 | + def __init__(self, zap): |
| 28 | + self.zap = zap |
| 29 | + |
| 30 | + def import_file(self, endurl, file, apikey=''): |
| 31 | + """ |
| 32 | + Imports a GraphQL Schema from a File. |
| 33 | + This component is optional and therefore the API will only work if it is installed |
| 34 | + """ |
| 35 | + return six.next(six.itervalues(self.zap._request(self.zap.base + 'graphql/action/importFile/', {'endurl': endurl, 'file': file, 'apikey': apikey}))) |
| 36 | + |
| 37 | + def import_url(self, endurl, url=None, apikey=''): |
| 38 | + """ |
| 39 | + Imports a GraphQL Schema from a URL. |
| 40 | + This component is optional and therefore the API will only work if it is installed |
| 41 | + """ |
| 42 | + params = {'endurl': endurl, 'apikey': apikey} |
| 43 | + if url is not None: |
| 44 | + params['url'] = url |
| 45 | + return six.next(six.itervalues(self.zap._request(self.zap.base + 'graphql/action/importUrl/', params))) |
0 commit comments