B `3!@sGdddeZdS)cseZdZfddZdedddZeeeedd d Zeeed d d Z eeeedddZ eeedddZ eedddZ eedddZ ZS)Licensescstt|||_dS)N)superr__init___session)selfsession) __class__q/private/var/folders/7j/8686xlfs15q3tgljmghtvg0r0000gn/T/pip-target-isidps9b/lib/python/meraki_v0/api/licenses.pyrszLicenses.__init__next)organizationIdc  s|td|krHddddddg}|d|ksHtd|dd |d gd d }d |d}ddddddgfdd|D}|j|||||S)a **List the licenses for an organization** https://developer.cisco.com/meraki/api/#!get-organization-licenses - organizationId (string) - total_pages (integer or string): total number of pages to retrieve, -1 or "all" for all pages - direction (string): direction to paginate, either "next" (default) or "prev" page - perPage (integer): The number of entries per page returned. Acceptable range is 3 - 1000. Default is 1000. - startingAfter (string): A token used by the server to indicate the start of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - endingBefore (string): A token used by the server to indicate the end of the page. Often this is a timestamp or an ID but it is not limited to those. This parameter should not be defined by client applications. The link for the first, last, prev, or next page in the HTTP Link header should define it. - deviceSerial (string): Filter the licenses to those assigned to a particular device - networkId (string): Filter the licenses to those assigned in a particular network - state (string): Filter the licenses to those in a particular state. Can be one of 'active', 'expired', 'expiring', 'unused', 'unusedActive' or 'recentlyQueued' stateactiveZexpiredZexpiringZunusedZ unusedActiveZrecentlyQueuedz"state" cannot be "z", & must be set to one of: rgetOrganizationLicenses)tags operationz/organizations/z /licensesZperPageZ startingAfterZ endingBefore deviceSerial networkIdcs&i|]\}}|kr||qSr)strip).0kv) query_paramsrr #sz4Licenses.getOrganizationLicenses..)updatelocalsAssertionErroritemsrZ get_pages) rr Z total_pages directionkwargsoptionsmetadataresourceparamsr)rr rs $ z Licenses.getOrganizationLicenses)r licenseIdr seatCountc sNt}dgdd}d|d}dddgfd d |D}|j|||S) a! **Assign SM seats to a network. This will increase the managed SM device limit of the network** https://developer.cisco.com/meraki/api/#!assign-organization-licenses-seats - organizationId (string) - licenseId (string): The ID of the SM license to assign seats from - networkId (string): The ID of the SM network to assign the seats to - seatCount (integer): The number of seats to assign to the SM network. Must be less than or equal to the total number of seats of the license rassignOrganizationLicensesSeats)rrz/organizations/z/licenses/assignSeatsr$rr%cs&i|]\}}|kr||qSr)r)rrr) body_paramsrr r<sz.)rrrpost) rr r$rr%rr!r"payloadr)r'r r&(s   z(Licenses.assignOrganizationLicensesSeats)r destOrganizationId licenseIdscsLt}dgdd}d|d}ddgfdd |D}|j|||S) a **Move licenses to another organization. This will also move any devices that the licenses are assigned to** https://developer.cisco.com/meraki/api/#!move-organization-licenses - organizationId (string) - destOrganizationId (string): The ID of the organization to move the licenses to - licenseIds (array): A list of IDs of licenses to move to the new organization rmoveOrganizationLicenses)rrz/organizations/z/licenses/mover*r+cs&i|]\}}|kr||qSr)r)rrr)r'rr rSsz5Licenses.moveOrganizationLicenses..)rrrr()rr r*r+rr!r"r)r)r'r r,@s  z!Licenses.moveOrganizationLicenses)r r*r$r%c sNt}dgdd}d|d}dddgfd d |D}|j|||S) a **Move SM seats to another organization** https://developer.cisco.com/meraki/api/#!move-organization-licenses-seats - organizationId (string) - destOrganizationId (string): The ID of the organization to move the SM seats to - licenseId (string): The ID of the SM license to move the seats from - seatCount (integer): The number of seats to move to the new organization. Must be less than or equal to the total number of seats of the license rmoveOrganizationLicensesSeats)rrz/organizations/z/licenses/moveSeatsr*r$r%cs&i|]\}}|kr||qSr)r)rrr)r'rr rksz:Licenses.moveOrganizationLicensesSeats..)rrrr() rr r*r$r%rr!r"r)r)r'r r-Ws   z&Licenses.moveOrganizationLicensesSeats)r licenseIdToRenewunusedLicenseIdcsLt}dgdd}d|d}ddgfdd |D}|j|||S) aO **Renew SM seats of a license. This will extend the license expiration date of managed SM devices covered by this license** https://developer.cisco.com/meraki/api/#!renew-organization-licenses-seats - organizationId (string) - licenseIdToRenew (string): The ID of the SM license to renew. This license must already be assigned to an SM network - unusedLicenseId (string): The SM license to use to renew the seats on 'licenseIdToRenew'. This license must have at least as many seats available as there are seats on 'licenseIdToRenew' rrenewOrganizationLicensesSeats)rrz/organizations/z/licenses/renewSeatsr.r/cs&i|]\}}|kr||qSr)r)rrr)r'rr rsz;Licenses.renewOrganizationLicensesSeats..)rrrr()rr r.r/rr!r"r)r)r'r r0os  z'Licenses.renewOrganizationLicensesSeats)r r$cCs*dgdd}d|d|}|j||S)z **Display a license** https://developer.cisco.com/meraki/api/#!get-organization-license - organizationId (string) - licenseId (string) rgetOrganizationLicense)rrz/organizations/z /licenses/)rget)rr r$r!r"rrr r1s zLicenses.getOrganizationLicensec sT|tdgdd}d|d|}dgfdd|D}|j|||S) a **Update a license** https://developer.cisco.com/meraki/api/#!update-organization-license - organizationId (string) - licenseId (string) - deviceSerial (string): The serial number of the device to assign this license to. Set this to null to unassign the license. If a different license is already active on the device, this parameter will control queueing/dequeuing this license. rupdateOrganizationLicense)rrz/organizations/z /licenses/rcs&i|]\}}|kr||qSr)r)rrr)r'rr rsz6Licenses.updateOrganizationLicense..)rrrrput)rr r$rr!r"r)r)r'r r3s z"Licenses.updateOrganizationLicense)r r )__name__ __module__ __qualname__rstrrintr&listr,r-r0r1r3 __classcell__rr)rr rs "rN)objectrrrrr