Skip to content

Commit 022e59d

Browse files
committed
Add new API options
Why is this change needed? -------------------------- We'd like to allow users to set the following options: - iframes - page_margin - pdf_forms How does it address the issue? ------------------------------ Add the options and regenerate the client. Any links to any relevant tickets, articles, or other resources? --------------------------------------------------------------- https://3.basecamp.com/3093825/buckets/29007795/todolists/5257298600 Did you complete all of the following? -------------------------------------- - Run test suite? - Add new tests? - Consider security implications and practices?
1 parent 4a8eb1a commit 022e59d

File tree

4 files changed

+90
-1
lines changed

4 files changed

+90
-1
lines changed

.review/generated_files/docs/PrinceOptions.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ Name | Type | Description | Notes
3535
**CssDpi** | **int** | Set the DPI when rendering CSS. Defaults to 96 but can be set with Prince 9.0 and up. | [optional]
3636
**Profile** | **string** | In Prince 9.0 and up you can set the PDF profile. | [optional]
3737
**PdfTitle** | **string** | Specify the PDF title, part of the document's metadata. | [optional]
38+
**Iframes** | **bool?** | Enable loading of iframes. | [optional]
39+
**PageMargin** | **string** | Specify the page margin distance. | [optional]
40+
**PdfForms** | **bool** | Make form fields editable by default. | [optional]
3841

3942
[[Back to Model list]](../README.md#documentation-for-models)
4043
[[Back to API list]](../README.md#documentation-for-api-endpoints)

.review/generated_files/src/DocRaptor.Test/Model/PrinceOptionsTests.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,30 @@ public void PdfTitleTest()
305305
{
306306
// TODO unit test for the property 'PdfTitle'
307307
}
308+
/// <summary>
309+
/// Test the property 'Iframes'
310+
/// </summary>
311+
[Test]
312+
public void IframesTest()
313+
{
314+
// TODO unit test for the property 'Iframes'
315+
}
316+
/// <summary>
317+
/// Test the property 'PageMargin'
318+
/// </summary>
319+
[Test]
320+
public void PageMarginTest()
321+
{
322+
// TODO unit test for the property 'PageMargin'
323+
}
324+
/// <summary>
325+
/// Test the property 'PdfForms'
326+
/// </summary>
327+
[Test]
328+
public void PdfFormsTest()
329+
{
330+
// TODO unit test for the property 'PdfForms'
331+
}
308332

309333
}
310334

docraptor.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,16 @@ components:
416416
pdf_title:
417417
type: string
418418
description: Specify the PDF title, part of the document's metadata.
419+
iframes:
420+
type: boolean
421+
description: Enable loading of iframes.
422+
nullable: true
423+
page_margin:
424+
type: string
425+
description: Specify the page margin distance.
426+
pdf_forms:
427+
type: boolean
428+
description: Make form fields editable by default.
419429

420430
AsyncDoc:
421431
type: object

src/DocRaptor/Model/PrinceOptions.cs

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,12 @@ public enum InputEnum
120120
/// <param name="cssDpi">Set the DPI when rendering CSS. Defaults to 96 but can be set with Prince 9.0 and up..</param>
121121
/// <param name="profile">In Prince 9.0 and up you can set the PDF profile..</param>
122122
/// <param name="pdfTitle">Specify the PDF title, part of the document&#39;s metadata..</param>
123-
public PrinceOptions(string baseurl = default(string), bool noXinclude = default(bool), bool noNetwork = default(bool), bool noParallelDownloads = default(bool), string httpUser = default(string), string httpPassword = default(string), string httpProxy = default(string), int httpTimeout = default(int), bool insecure = default(bool), string media = default(string), bool noAuthorStyle = default(bool), bool noDefaultStyle = default(bool), bool noEmbedFonts = default(bool), bool noSubsetFonts = default(bool), bool noCompress = default(bool), bool encrypt = default(bool), KeyBitsEnum? keyBits = default(KeyBitsEnum?), string userPassword = default(string), string ownerPassword = default(string), bool disallowPrint = default(bool), bool disallowCopy = default(bool), bool disallowAnnotate = default(bool), bool disallowModify = default(bool), bool debug = default(bool), InputEnum? input = default(InputEnum?), string version = default(string), bool javascript = default(bool), int cssDpi = default(int), string profile = default(string), string pdfTitle = default(string))
123+
/// <param name="iframes">Enable loading of iframes..</param>
124+
/// <param name="pageMargin">Specify the page margin distance..</param>
125+
/// <param name="pdfForms">Make form fields editable by default..</param>
126+
public PrinceOptions(string baseurl = default(string), bool noXinclude = default(bool), bool noNetwork = default(bool), bool noParallelDownloads = default(bool), string httpUser = default(string), string httpPassword = default(string), string httpProxy = default(string), int httpTimeout = default(int), bool insecure = default(bool), string media = default(string), bool noAuthorStyle = default(bool), bool noDefaultStyle = default(bool), bool noEmbedFonts = default(bool), bool noSubsetFonts = default(bool), bool noCompress = default(bool), bool encrypt = default(bool), KeyBitsEnum? keyBits = default(KeyBitsEnum?), string userPassword = default(string), string ownerPassword = default(string), bool disallowPrint = default(bool), bool disallowCopy = default(bool), bool disallowAnnotate = default(bool), bool disallowModify = default(bool), bool debug = default(bool), InputEnum? input = default(InputEnum?), string version = default(string), bool javascript = default(bool), int cssDpi = default(int), string profile = default(string), string pdfTitle = default(string), bool? iframes = default(bool?), string pageMargin = default(string), bool pdfForms = default(bool))
124127
{
128+
this.Iframes = iframes;
125129
this.Baseurl = baseurl;
126130
this.NoXinclude = noXinclude;
127131
this.NoNetwork = noNetwork;
@@ -152,6 +156,9 @@ public enum InputEnum
152156
this.CssDpi = cssDpi;
153157
this.Profile = profile;
154158
this.PdfTitle = pdfTitle;
159+
this.Iframes = iframes;
160+
this.PageMargin = pageMargin;
161+
this.PdfForms = pdfForms;
155162
}
156163

157164
/// <summary>
@@ -353,6 +360,27 @@ public enum InputEnum
353360
[DataMember(Name="pdf_title", EmitDefaultValue=false)]
354361
public string PdfTitle { get; set; }
355362

363+
/// <summary>
364+
/// Enable loading of iframes.
365+
/// </summary>
366+
/// <value>Enable loading of iframes.</value>
367+
[DataMember(Name="iframes", EmitDefaultValue=true)]
368+
public bool? Iframes { get; set; }
369+
370+
/// <summary>
371+
/// Specify the page margin distance.
372+
/// </summary>
373+
/// <value>Specify the page margin distance.</value>
374+
[DataMember(Name="page_margin", EmitDefaultValue=false)]
375+
public string PageMargin { get; set; }
376+
377+
/// <summary>
378+
/// Make form fields editable by default.
379+
/// </summary>
380+
/// <value>Make form fields editable by default.</value>
381+
[DataMember(Name="pdf_forms", EmitDefaultValue=false)]
382+
public bool PdfForms { get; set; }
383+
356384
/// <summary>
357385
/// Returns the string presentation of the object
358386
/// </summary>
@@ -391,6 +419,9 @@ public override string ToString()
391419
sb.Append(" CssDpi: ").Append(CssDpi).Append("\n");
392420
sb.Append(" Profile: ").Append(Profile).Append("\n");
393421
sb.Append(" PdfTitle: ").Append(PdfTitle).Append("\n");
422+
sb.Append(" Iframes: ").Append(Iframes).Append("\n");
423+
sb.Append(" PageMargin: ").Append(PageMargin).Append("\n");
424+
sb.Append(" PdfForms: ").Append(PdfForms).Append("\n");
394425
sb.Append("}\n");
395426
return sb.ToString();
396427
}
@@ -574,6 +605,21 @@ public bool Equals(PrinceOptions input)
574605
this.PdfTitle == input.PdfTitle ||
575606
(this.PdfTitle != null &&
576607
this.PdfTitle.Equals(input.PdfTitle))
608+
) &&
609+
(
610+
this.Iframes == input.Iframes ||
611+
(this.Iframes != null &&
612+
this.Iframes.Equals(input.Iframes))
613+
) &&
614+
(
615+
this.PageMargin == input.PageMargin ||
616+
(this.PageMargin != null &&
617+
this.PageMargin.Equals(input.PageMargin))
618+
) &&
619+
(
620+
this.PdfForms == input.PdfForms ||
621+
(this.PdfForms != null &&
622+
this.PdfForms.Equals(input.PdfForms))
577623
);
578624
}
579625

@@ -646,6 +692,12 @@ public override int GetHashCode()
646692
hashCode = hashCode * 59 + this.Profile.GetHashCode();
647693
if (this.PdfTitle != null)
648694
hashCode = hashCode * 59 + this.PdfTitle.GetHashCode();
695+
if (this.Iframes != null)
696+
hashCode = hashCode * 59 + this.Iframes.GetHashCode();
697+
if (this.PageMargin != null)
698+
hashCode = hashCode * 59 + this.PageMargin.GetHashCode();
699+
if (this.PdfForms != null)
700+
hashCode = hashCode * 59 + this.PdfForms.GetHashCode();
649701
return hashCode;
650702
}
651703
}

0 commit comments

Comments
 (0)